Beispiel #1
0
        public IDictionary <string, string> Variables(ThemeValue theme)
        {
            var isDark = theme.IsDark();

            return(new Dictionary <string, string>
            {
                ["--theme-docs-palette-border-color"] = (isDark ? "rgba(255, 255, 255, 0.12)" : "rgba(0, 0, 0, 0.12)"),
            });
        }
        public IDictionary <string, string> Variables(ThemeValue theme)
        {
            var palette = theme.Palette;

            var isDark = theme.IsDark();

            return(new Dictionary <string, string>
            {
                { "--theme-component-button-border-outlined", (isDark ? "rgba(255, 255, 255, 0.23)" : "rgba(0, 0, 0, 0.23)").ToString(CultureInfo.InvariantCulture) },
            });
        }
        public IDictionary <string, string> Variables(ThemeValue theme)
        {
            var isDark = theme.IsDark();

            var palette = theme.Palette;

            return(new Dictionary <string, string>
            {
                { "--theme-component-avatar-background", (isDark ? palette.Grey.X600 : palette.Grey.X400).ToString(CultureInfo.InvariantCulture) }
            });
        }
Beispiel #4
0
        public IDictionary <string, string> Variables(ThemeValue theme)
        {
            var isDark = theme.IsDark();

            var palette = theme.Palette;

            return(new Dictionary <string, string>
            {
                { "--theme-component-table-row-background-selected", (isDark ? "rgba(255, 255, 255, 0.08)" : "rgba(0, 0, 0, 0.04)").ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-table-row-background-hover", (isDark ? "rgba(255, 255, 255, 0.14)" : "rgba(0, 0, 0, 0.07)").ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-table-cell-border-bottom", (isDark ? palette.Divider.Fade(1).Darken(0.68m) : palette.Divider.Fade(1).Lighten(0.88m)).ToString(CultureInfo.InvariantCulture) }
            });
        }
        public IDictionary <string, string> Variables(ThemeValue theme)
        {
            var isDark = theme.IsDark();

            var palette = theme.Palette;

            return(new Dictionary <string, string>
            {
                { "--theme-component-switch-color", (isDark ? palette.Grey.X400 : palette.Grey.X50).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-switch-disabled-color", (isDark ? palette.Grey.X800 : palette.Grey.X400).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-switch-disabled-opacity", (isDark ? 0.1 : 0.12).ToString(CultureInfo.InvariantCulture) },
            });
        }
        public IDictionary <string, string> Variables(ThemeValue theme)
        {
            var palette = theme.Palette;

            string ToContrastText(string color)
            {
                return(color.ToContrastText(palette.ContrastThreshold));
            }

            var isDark = theme.IsDark();

            return(new Dictionary <string, string>
            {
                { "--theme-component-chip-color", ToContrastText(isDark ? palette.Grey.X700 : palette.Grey.X300).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-background-color", (isDark ? palette.Grey.X700 : palette.Grey.X300).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-clickable-focus", (isDark ? palette.Grey.X700 : palette.Grey.X300).Emphasize(0.08m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-clickable-active", (isDark ? palette.Grey.X700 : palette.Grey.X300).Emphasize(0.12m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-clickable-primary-focus", palette.Primary.Main.Emphasize(0.08m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-clickable-primary-active", palette.Primary.Main.Emphasize(0.12m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-clickable-secondary-focus", palette.Secondary.Main.Emphasize(0.08m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-clickable-secondary-active", palette.Secondary.Main.Emphasize(0.12m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-deletable-focus", (isDark ? palette.Grey.X700 : palette.Grey.X300).Emphasize(0.08m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-deletable-primary-focus", palette.Primary.Main.Emphasize(0.2m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-deletable-secondary-focus", palette.Secondary.Main.Emphasize(0.2m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-outlined-focus", palette.Text.Primary.Fade(palette.Action.HoverOpacity).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-outlined-primary-focus", palette.Primary.Main.Fade(palette.Action.HoverOpacity).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-outlined-secondary-focus", palette.Secondary.Main.Fade(palette.Action.HoverOpacity).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-avatar-color", (isDark ? palette.Grey.X300 : palette.Grey.X700).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-icon-color", (isDark ? palette.Grey.X300 : palette.Grey.X700).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-delete-icon-color", palette.Text.Primary.Fade(0.26m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-delete-icon-color-hover", palette.Text.Primary.Fade(0.26m).Fade(0.4m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-delete-icon-primary-color", palette.Primary.ContrastText.Fade(0.7m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-delete-icon-secondary-color", palette.Secondary.ContrastText.Fade(0.7m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-delete-icon-outlined-primary-color", palette.Primary.Main.Fade(0.7m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-delete-icon-outlined-secondary-color", palette.Secondary.Main.Fade(0.7m).ToString(CultureInfo.InvariantCulture) },
                { "--theme-component-chip-border-outlined", (isDark ? "rgba(255, 255, 255, 0.23)" : "rgba(0, 0, 0, 0.23)").ToString(CultureInfo.InvariantCulture) },
            });
        }
        public IDictionary <string, string> Variables(ThemeValue theme)
        {
            var isDark = theme.IsDark();

            var palette = isDark ? Dark : Light;

            return(new Dictionary <string, string>
            {
                ["--theme-palette-error-color"] = (isDark ? theme.Palette.Error.Main.Lighten(0.6m) : theme.Palette.Error.Main.Darken(0.6m)).ToString(CultureInfo.InvariantCulture),
                ["--theme-palette-error-background"] = (isDark ? theme.Palette.Error.Main.Darken(0.9m) : theme.Palette.Error.Main.Lighten(0.9m)).ToString(CultureInfo.InvariantCulture),

                ["--theme-palette-success-main"] = (palette.Success.Main.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-success-light"] = (palette.Success.Light.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-success-dark"] = (palette.Success.Dark.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-success-contrast-text"] = (palette.Success.ContrastText.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-success-alternate"] = (isDark ? palette.Success.Light : palette.Success.Dark).ToString(CultureInfo.InvariantCulture),
                ["--theme-palette-success-color"] = (isDark ? palette.Success.Main.Lighten(0.6m) : palette.Success.Main.Darken(0.6m)).ToString(CultureInfo.InvariantCulture),
                ["--theme-palette-success-background"] = (isDark ? palette.Success.Main.Darken(0.9m) : palette.Success.Main.Lighten(0.9m)).ToString(CultureInfo.InvariantCulture),

                ["--theme-palette-warning-main"] = (palette.Warning.Main.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-warning-light"] = (palette.Warning.Light.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-warning-dark"] = (palette.Warning.Dark.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-warning-contrast-text"] = (palette.Warning.ContrastText.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-warning-alternate"] = (isDark ? palette.Warning.Light : palette.Warning.Dark).ToString(CultureInfo.InvariantCulture),
                ["--theme-palette-warning-color"] = (isDark ? palette.Warning.Main.Lighten(0.6m) : palette.Warning.Main.Darken(0.6m)).ToString(CultureInfo.InvariantCulture),
                ["--theme-palette-warning-background"] = (isDark ? palette.Warning.Main.Darken(0.9m) : palette.Warning.Main.Lighten(0.9m)).ToString(CultureInfo.InvariantCulture),

                ["--theme-palette-info-main"] = (palette.Info.Main.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-info-light"] = (palette.Info.Light.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-info-dark"] = (palette.Info.Dark.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-info-contrast-text"] = (palette.Info.ContrastText.ToString(CultureInfo.InvariantCulture)),
                ["--theme-palette-info-alternate"] = (isDark ? palette.Info.Light : palette.Info.Dark).ToString(CultureInfo.InvariantCulture),
                ["--theme-palette-info-color"] = (isDark ? palette.Info.Main.Lighten(0.6m) : palette.Info.Main.Darken(0.6m)).ToString(CultureInfo.InvariantCulture),
                ["--theme-palette-info-background"] = (isDark ? palette.Info.Main.Darken(0.9m) : palette.Info.Main.Lighten(0.9m)).ToString(CultureInfo.InvariantCulture),
            });
        }