Esempio n. 1
0
 protected abstract void GenerateBarStyles(StringBuilder sb, Theme theme, ThemeBarOptions options);
Esempio n. 2
0
        protected virtual void GenerateBarVariables(ThemeBarOptions barOptions)
        {
            if (!string.IsNullOrEmpty(barOptions.VerticalWidth))
            {
                variables[ThemeVariables.VerticalBarWidth] = barOptions.VerticalWidth;
            }

            if (!string.IsNullOrEmpty(barOptions.VerticalSmallWidth))
            {
                variables[ThemeVariables.VerticalBarSmallWidth] = barOptions.VerticalSmallWidth;
            }

            if (!string.IsNullOrEmpty(barOptions.VerticalBrandHeight))
            {
                variables[ThemeVariables.VerticalBarBrandHeight] = barOptions.VerticalBrandHeight;
            }

            if (!string.IsNullOrEmpty(barOptions.VerticalPopoutMenuWidth))
            {
                variables[ThemeVariables.VerticalPopoutMenuWidth] = barOptions.VerticalPopoutMenuWidth;
            }

            if (!string.IsNullOrEmpty(barOptions.HorizontalHeight))
            {
                variables[ThemeVariables.HorizontalBarHeight] = barOptions.HorizontalHeight;
            }

            if (barOptions?.DarkColors != null)
            {
                variables[ThemeVariables.BarDarkBackground] = ToHex(ParseColor(barOptions.DarkColors.BackgroundColor));
                variables[ThemeVariables.BarDarkColor]      = ToHex(ParseColor(barOptions.DarkColors.Color));

                if (barOptions.DarkColors.ItemColorOptions != null)
                {
                    variables[ThemeVariables.BarItemDarkActiveBackground] = ToHex(ParseColor(barOptions.DarkColors.ItemColorOptions.ActiveBackgroundColor));
                    variables[ThemeVariables.BarItemDarkActiveColor]      = ToHex(ParseColor(barOptions.DarkColors.ItemColorOptions.ActiveColor));

                    variables[ThemeVariables.BarItemDarkHoverBackground] = ToHex(ParseColor(barOptions.DarkColors.ItemColorOptions.HoverBackgroundColor));
                    variables[ThemeVariables.BarItemDarkHoverColor]      = ToHex(ParseColor(barOptions.DarkColors.ItemColorOptions.HoverColor));
                }

                if (barOptions.DarkColors.DropdownColorOptions != null)
                {
                    variables[ThemeVariables.BarDropdownDarkBackground] = ToHex(ParseColor(barOptions.DarkColors.DropdownColorOptions.BackgroundColor));
                }

                if (barOptions.DarkColors.BrandColorOptions != null)
                {
                    variables[ThemeVariables.BarBrandDarkBackground] = ToHex(ParseColor(barOptions.DarkColors.BrandColorOptions.BackgroundColor));
                }
            }

            if (barOptions?.LightColors != null)
            {
                variables[ThemeVariables.BarLightBackground] = ToHex(ParseColor(barOptions.LightColors.BackgroundColor));
                variables[ThemeVariables.BarLightColor]      = ToHex(ParseColor(barOptions.LightColors.Color));

                if (barOptions.LightColors.ItemColorOptions != null)
                {
                    variables[ThemeVariables.BarItemLightActiveBackground] = ToHex(ParseColor(barOptions.LightColors.ItemColorOptions.ActiveBackgroundColor));
                    variables[ThemeVariables.BarItemLightActiveColor]      = ToHex(ParseColor(barOptions.LightColors.ItemColorOptions.ActiveColor));

                    variables[ThemeVariables.BarItemLightHoverBackground] = ToHex(ParseColor(barOptions.LightColors.ItemColorOptions.HoverBackgroundColor));
                    variables[ThemeVariables.BarItemLightHoverColor]      = ToHex(ParseColor(barOptions.LightColors.ItemColorOptions.HoverColor));
                }

                if (barOptions.LightColors.DropdownColorOptions != null)
                {
                    variables[ThemeVariables.BarDropdownLightBackground] = ToHex(ParseColor(barOptions.LightColors.DropdownColorOptions.BackgroundColor));
                }

                if (barOptions.LightColors.BrandColorOptions != null)
                {
                    variables[ThemeVariables.BarBrandLightBackground] = ToHex(ParseColor(barOptions.LightColors.BrandColorOptions.BackgroundColor));
                }
            }
        }