Example #1
0
        protected override void GenerateButtonVariantStyles(StringBuilder sb, Theme theme, string variant, ThemeButtonOptions options)
        {
            var background      = Var(ThemeVariables.ButtonBackgrund(variant));
            var border          = Var(ThemeVariables.ButtonBorder(variant));
            var hoverBackground = Var(ThemeVariables.ButtonHoverBackground(variant));
            //var hoverBorder = Var( ThemeVariables.ButtonHoverBorder( variant ) );
            //var activeBackground = Var( ThemeVariables.ButtonActiveBackground( variant ) );
            //var activeBorder = Var( ThemeVariables.ButtonActiveBorder( variant ) );
            var yiqBackground = Var(ThemeVariables.ButtonYiqBackground(variant));
            //var yiqHoverBackground = Var( ThemeVariables.ButtonYiqHoverBackground( variant ) );
            //var yiqActiveBackground = Var( ThemeVariables.ButtonYiqActiveBackground( variant ) );
            var boxShadow = Var(ThemeVariables.ButtonBoxShadow(variant));

            sb.Append($".e-btn.{variant}").Append("{")
            .Append($"color: {yiqBackground};")
            .Append(GetGradientBg(theme, background, options?.GradientBlendPercentage))
            .Append($"border-color: {border};")
            .AppendLine("}");

            sb.Append($".e-btn.{variant}:hover,")
            .Append($".e-btn.{variant}:focus")
            .Append("{")
            .Append(GetGradientBg(theme, hoverBackground, options?.GradientBlendPercentage))
            .Append($"box-shadow: 0 0 0 {options?.BoxShadowSize ?? ".2rem"} {boxShadow};")
            .AppendLine("}");

            //sb.Append( $".e-btn.{variant}:focus" ).Append( $".e-btn.{variant}.focus" ).Append( "{" )
            //    .Append( $"color: {yiqHoverBackground};" )
            //    .Append( GradientBg( theme, hoverBackground ) )
            //    .Append( $"border-color: {hoverBorder};" )
            //    .Append( $"box-shadow: 0 0 0 {options?.BoxShadowSize ?? ".2rem"} {boxShadow};" )
            //    .AppendLine( "}" );

            //sb.Append( $".e-btn.{variant}.disabled" ).Append( $".e-btn.{variant}:disabled" ).Append( "{" )
            //    .Append( $"color: {yiqBackground};" )
            //    .Append( $"background-color: {background};" )
            //    .Append( $"border-color: {border};" )
            //    .Append( $"box-shadow: 0 0 0 {options?.BoxShadowSize ?? ".2rem"} {boxShadow};" )
            //    .AppendLine( "}" );

            //sb
            //    .Append( $".e-btn.{variant}:not(:disabled):not(.disabled):active," )
            //    .Append( $".e-btn.{variant}:not(:disabled):not(.disabled).active," )
            //    .Append( $".show>.e-btn.{variant}.dropdown-toggle" )
            //    .Append( "{" )
            //    .Append( $"color: {yiqActiveBackground};" )
            //    .Append( $"background-color: {activeBackground};" )
            //    .Append( $"border-color: {activeBorder};" )
            //    .AppendLine( "}" );

            //sb
            //    .Append( $".e-btn.{variant}:not(:disabled):not(.disabled):active:focus," )
            //    .Append( $".e-btn.{variant}:not(:disabled):not(.disabled).active:focus," )
            //    .Append( $".show>.e-btn.{variant}.dropdown-toggle:focus" )
            //    .Append( "{" )
            //    .Append( $"box-shadow: 0 0 0 {options?.BoxShadowSize ?? ".2rem"} {boxShadow}" )
            //    .AppendLine( "}" );
        }
        protected override void GenerateButtonVariantStyles(StringBuilder sb, Theme theme, string variant, ThemeButtonOptions options)
        {
            var background          = Var(ThemeVariables.ButtonBackgrund(variant));
            var border              = Var(ThemeVariables.ButtonBorder(variant));
            var hoverBackground     = Var(ThemeVariables.ButtonHoverBackground(variant));
            var hoverBorder         = Var(ThemeVariables.ButtonHoverBorder(variant));
            var activeBackground    = Var(ThemeVariables.ButtonActiveBackground(variant));
            var activeBorder        = Var(ThemeVariables.ButtonActiveBorder(variant));
            var yiqBackground       = Var(ThemeVariables.ButtonYiqBackground(variant));
            var yiqHoverBackground  = Var(ThemeVariables.ButtonYiqHoverBackground(variant));
            var yiqActiveBackground = Var(ThemeVariables.ButtonYiqActiveBackground(variant));
            var boxShadow           = Var(ThemeVariables.ButtonBoxShadow(variant));

            sb.Append($".button.is-{variant}").Append("{")
            //.Append( $"color: {yiqBackground};" )
            .Append(GetGradientBg(theme, background, options?.GradientBlendPercentage))
            .Append($"border-color: transparent;")
            .AppendLine("}");

            sb.Append($".button.is-{variant}:hover,").Append($".button.is-{variant}.is-hovered").Append("{")
            .Append($"color: {yiqHoverBackground};")
            .Append(GetGradientBg(theme, hoverBackground, options?.GradientBlendPercentage))
            .Append($"border-color: {hoverBorder};")
            .AppendLine("}");

            sb.Append($".button.is-{variant}:focus,").Append($".button.is-{variant}.is-focused").Append("{")
            .Append($"color: {yiqHoverBackground};")
            .Append(GetGradientBg(theme, hoverBackground, options?.GradientBlendPercentage))
            .Append($"border-color: transparent;")
            .AppendLine("}");

            sb.Append($".button.is-{variant}:focus:not(:active),").Append($".button.is-{variant}.is-focused:not(:active)").Append("{")
            .Append($"box-shadow: 0 0 0 {options?.BoxShadowSize ?? ".125rem"} {boxShadow};")
            .AppendLine("}");

            sb.Append($".button.is-{variant}[disabled],").Append($"fieldset[disabled] .button.is-{variant}").Append("{")
            .Append($"color: {yiqBackground};")
            .Append($"background-color: {background};")
            .Append($"border-color: {border};")
            .Append($"box-shadow: none;")
            .AppendLine("}");

            sb
            .Append($".button.is-{variant}:active,").Append($".button.is-{variant}.is-active").Append("{")
            .Append($"color: {yiqActiveBackground};")
            .Append($"background-color: {activeBackground};")
            .Append($"border-color: {activeBorder};")
            .AppendLine("}");

            sb
            .Append($".button.is-{variant}.is-loading::after").Append("{")
            .Append($"border-color: transparent transparent {activeBorder} {activeBorder};")
            .AppendLine("}");

            //sb
            //    .Append( $".btn-{variant}:not(:disabled):not(.disabled):active:focus," )
            //    .Append( $".btn-{variant}:not(:disabled):not(.disabled).active:focus," )
            //    .Append( $".show>.btn-{variant}.dropdown-toggle:focus" )
            //    .Append( "{" )
            //    .Append( $"box-shadow: 0 0 0 {options?.BoxShadowSize ?? ".2rem"} {boxShadow}" )
            //    .AppendLine( "}" );
        }