コード例 #1
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb.Append($".e-control").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".e-control-helper").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".e-select").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            if (!string.IsNullOrEmpty(options?.Color))
            {
                sb.Append($".e-control").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");

                sb.Append($".e-control-helper").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");

                sb.Append($".e-select").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");
            }
        }
コード例 #2
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            base.GenerateInputStyles(sb, theme, options);

            if (!string.IsNullOrEmpty(theme.ColorOptions?.Primary))
            {
                var focusColor = Var(ThemeVariables.Color("primary"));

                sb
                .Append(".form-control:focus,")
                .Append(".custom-select:focus")
                .Append("{")
                .Append($"border-color: {focusColor};")
                .Append($"box-shadow: inset 0 -2px 0 -1px {focusColor};")
                .AppendLine("}");

                sb
                .Append("select.custom-select:focus[multiple], select.custom-select:focus[size]:not([size=\"1\"]), select.form-control:focus[multiple], select.form-control:focus[size]:not([size=\"1\"]), textarea.form-control:focus:not([rows=\"1\"])")
                .Append("{")
                .Append($"border-color: {focusColor};")
                .Append($"box-shadow: inset 2px 2px 0 -1px {focusColor}, inset -2px -2px 0 -1px {focusColor};")
                .AppendLine("}");

                sb
                .Append(".form-group:focus-within label:not(.custom-control-label):not(.form-check-label):not(.btn):not(.card-link), [class*=form-ripple]:focus-within label:not(.custom-control-label):not(.form-check-label):not(.btn):not(.card-link)")
                .Append("{")
                .Append($"color: {focusColor};")
                .AppendLine("}");
            }
        }
コード例 #3
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb.Append($".ant-form-item input").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".ant-input-group-addon:first-child").Append("{")
            .Append($"border-top-left-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .Append($"border-bottom-left-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".ant-input-group-addon:last-child").Append("{")
            .Append($"border-top-right-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .Append($"border-bottom-right-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".ant-select-selector, .ant-select-selector input").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )} !important;")
            .AppendLine("}");

            sb.Append($".ant-checkbox-inner").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".ant-upload button").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            if (!string.IsNullOrEmpty(options?.Color))
            {
                sb.Append($".ant-input").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");

                //sb.Append( $".input-group-text" ).Append( "{" )
                //    .Append( $"color: {options.Color};" )
                //    .AppendLine( "}" );

                sb.Append($".ant-select-selection-search-input").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");
            }

            if (!string.IsNullOrEmpty(options?.CheckColor))
            {
                GenerateInputCheckEditStyles(sb, theme, options);
            }

            if (!string.IsNullOrEmpty(options?.SliderColor))
            {
                GenerateInputSliderStyles(sb, theme, options);
            }
        }
コード例 #4
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb.Append($".input").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".select select").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".textarea").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");
        }
コード例 #5
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb.Append($".input").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".select select").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".textarea").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            if (!string.IsNullOrEmpty(options?.CheckColor))
            {
                GenerateInputCheckEditStyles(sb, theme, options);
            }
        }
コード例 #6
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb.Append($".form-control").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".input-group-text").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".custom-select").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".custom-checkbox .custom-control-label::before").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append($".custom-file-label").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            if (!string.IsNullOrEmpty(options?.Color))
            {
                sb.Append($".form-control").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");

                sb.Append($".input-group-text").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");

                sb.Append($".custom-select").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");
            }

            if (!string.IsNullOrEmpty(options?.CheckColor))
            {
                GenerateInputCheckEditStyles(sb, theme, options);
            }
        }
コード例 #7
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb
            .Append($".flatpickr-day.selected").Append("{")
            .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
            .AppendLine("}");

            sb
            .Append($".flatpickr-time .flatpickr-am-pm").Append("{")
            .Append($"color: { Var( ThemeVariables.Color( "primary" ) )};")
            .AppendLine("}");

            sb
            .Append($".flatpickr-time .flatpickr-am-pm:focus, .flatpickr-time input:focus").Append("{")
            .Append($"background: { ToHex( Transparency( Var( ThemeVariables.Color( "primary" ) ), 16 ) )};")
            .Append($"color: { Var( ThemeVariables.Color( "primary" ) )};")
            .AppendLine("}");

            base.GenerateInputStyles(sb, theme, options);
        }
コード例 #8
0
        protected virtual void GenerateInputCheckEditStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb
            .Append($".custom-checkbox .custom-control-input:checked ~ .custom-control-label::before").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".custom-control-input:checked ~ .custom-control-label::before").Append("{")
            .Append($"color: {options.Color};")
            .Append($"border-color: {options.CheckColor};")
            .Append($"background-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".custom-switch .custom-control-input:checked ~ .custom-control-label::before").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .AppendLine("}");
        }
コード例 #9
0
        protected virtual void GenerateInputSliderStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb.Append($".ant-slider-track").Append("{")
            .Append($"background-color: {options.SliderColor};")
            .AppendLine("}");

            sb.Append($".ant-slider:hover .ant-slider-track").Append("{")
            .Append($"background-color: {ToHex( Darken( options.SliderColor, 20f ) )};")
            .AppendLine("}");

            sb.Append($".ant-slider-handle").Append("{")
            .Append($"border-color: {options.SliderColor};")
            .AppendLine("}");

            sb
            .Append($".ant-slider-handle:focus,")
            .Append($".ant-slider:hover .ant-slider-handle:not(.ant-tooltip-open)")
            .Append("{")
            .Append($"border-color: {ToHex( Darken( options.SliderColor, 20f ) )};")
            .AppendLine("}");
        }
コード例 #10
0
        protected virtual void GenerateInputCheckEditStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb
            .Append($".ant-checkbox-checked .ant-checkbox-inner").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .Append($"border-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".ant-radio-wrapper:hover .ant-radio,")
            .Append($".ant-radio:hover .ant-radio-inner,")
            .Append($".ant-radio-input:focus + .ant-radio-inner,")
            .Append($".ant-radio-checked .ant-radio-inner")
            .Append("{")
            .Append($"border-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".ant-radio-inner::after").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".ant-switch-checked").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .AppendLine("}");
        }
コード例 #11
0
        protected override void GenerateInputCheckEditStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb
            .Append($".custom-checkbox .custom-control-input:checked ~ .custom-control-label::before").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".custom-control-input:checked ~ .custom-control-label::after").Append("{")
            .Append($"color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".custom-control-input:checked ~ .custom-control-label::before").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".custom-switch .custom-control-input:checked ~ .custom-control-label::after").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .AppendLine("}");

            var trackColor = ToHex(Lighten(options.CheckColor, 50f));

            if (!string.IsNullOrEmpty(trackColor))
            {
                sb
                .Append($".custom-switch .custom-control-input:checked~.custom-control-track").Append("{")
                .Append($"background-color: {trackColor};")
                .AppendLine("}");
            }
        }
コード例 #12
0
 protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
 {
     throw new System.NotImplementedException();
 }
コード例 #13
0
        protected virtual void GenerateInputCheckEditStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb
            .Append($".is-checkradio[type=\"checkbox\"] + label::after, .is-checkradio[type=\"checkbox\"] + label:after").Append("{")
            .Append($"border-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".is-checkradio[type=\"radio\"] + label::after, .is-checkradio[type=\"radio\"] + label:after").Append("{")
            .Append($"background: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append($".is-checkradio[type=\"radio\"]:hover:not([disabled]) + label::before, .is-checkradio[type=\"radio\"]:hover:not([disabled]) + label:before, .is-checkradio[type=\"checkbox\"]:hover:not([disabled]) + label::before, .is-checkradio[type=\"checkbox\"]:hover:not([disabled]) + label:before").Append("{")
            .Append($"border-color: {options.CheckColor} !important;")
            .AppendLine("}");
        }
コード例 #14
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb.Append(".input").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".select select").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".textarea").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".b-is-autocomplete.b-is-autocomplete-multipleselection").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            if (!string.IsNullOrEmpty(options?.CheckColor))
            {
                GenerateInputCheckEditStyles(sb, theme, options);
            }

            if (!string.IsNullOrEmpty(theme.ColorOptions?.Primary))
            {
                sb
                .Append(".flatpickr-months .flatpickr-month:hover svg,")
                .Append(".flatpickr-months .flatpickr-next-month:hover svg,")
                .Append(".flatpickr-months .flatpickr-prev-month:hover svg")
                .Append("{")
                .Append($"fill: { Var( ThemeVariables.Color( "primary" ) )} !important;")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange, .flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus, .flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover, .flatpickr-day.selected.prevMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.endRange.prevMonthDay, .flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.nextMonthDay").Append("{")
                .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
                .Append($"border-color: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day:hover").Append("{")
                .Append($"background: { ToHex( Lighten( Var( ThemeVariables.Color( "primary" ) ), 90f ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1))").Append("{")
                .Append($"box-shadow: -10px 0 0 { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.today").Append("{")
                .Append($"border-color: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.today:hover").Append("{")
                .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
                .Append($"border-color: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-monthSelect-month:hover,.flatpickr-monthSelect-month:focus").Append("{")
                .Append($"background: { ToHex( Lighten( Var( ThemeVariables.Color( "primary" ) ), 90f ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-monthSelect-month.selected").Append("{")
                .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");
            }
        }
コード例 #15
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb.Append(".form-control").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".input-group-text").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".form-select").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".form-check:not(.form-switch) .form-check-input[type=checkbox]").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            if (!string.IsNullOrEmpty(options?.Color))
            {
                sb.Append(".form-control").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");

                sb.Append(".input-group-text").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");

                sb.Append(".form-select").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");
            }

            if (!string.IsNullOrEmpty(options?.CheckColor))
            {
                GenerateInputCheckEditStyles(sb, theme, options);
            }

            if (!string.IsNullOrEmpty(theme.ColorOptions?.Primary))
            {
                var focusColor = ToHex(Lighten(Var(ThemeVariables.Color("primary")), 75f));

                sb
                .Append(".form-control:focus,")
                .Append(".form-select:focus,")
                .Append(".b-is-autocomplete.b-is-autocomplete-multipleselection.focus")
                .Append("{")
                .Append($"border-color: {focusColor};")
                .Append($"box-shadow: 0 0 0 {theme.ButtonOptions?.BoxShadowSize ?? ".2rem"} {focusColor};")
                .AppendLine("}");
            }

            if (!string.IsNullOrEmpty(theme.ColorOptions?.Primary))
            {
                sb
                .Append(".flatpickr-months .flatpickr-month:hover svg,")
                .Append(".flatpickr-months .flatpickr-next-month:hover svg,")
                .Append(".flatpickr-months .flatpickr-prev-month:hover svg")
                .Append("{")
                .Append($"fill: { Var( ThemeVariables.Color( "primary" ) )} !important;")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange, .flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus, .flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover, .flatpickr-day.selected.prevMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.endRange.prevMonthDay, .flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.nextMonthDay").Append("{")
                .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
                .Append($"border-color: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day:hover").Append("{")
                .Append($"background: { ToHex( Lighten( Var( ThemeVariables.Color( "primary" ) ), 90f ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1))").Append("{")
                .Append($"box-shadow: -10px 0 0 { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.today").Append("{")
                .Append($"border-color: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.today:hover").Append("{")
                .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
                .Append($"border-color: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-monthSelect-month:hover,.flatpickr-monthSelect-month:focus").Append("{")
                .Append($"background: { ToHex( Lighten( Var( ThemeVariables.Color( "primary" ) ), 90f ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-monthSelect-month.selected").Append("{")
                .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                //sb
                //    .Append( $".flatpickr-time .flatpickr-am-pm" ).Append( "{" )
                //    .Append( $"color: { Var( ThemeVariables.Color( "primary" ) )};" )
                //    .AppendLine( "}" );

                //sb
                //    .Append( $".flatpickr-time .flatpickr-am-pm:focus, .flatpickr-time input:focus" ).Append( "{" )
                //    .Append( $"background: { ToHex( Transparency( Var( ThemeVariables.Color( "primary" ) ), 16 ) )};" )
                //    .Append( $"color: { Var( ThemeVariables.Color( "primary" ) )};" )
                //    .AppendLine( "}" );
            }

            sb.Append($".form-range::-webkit-slider-thumb")
            .Append("{")
            .Append($"background-color: { Var( ThemeVariables.Color( "primary" ) )};")
            .AppendLine("}");

            sb.Append($".form-range:focus::-webkit-slider-thumb")
            .Append("{")
            .Append($"box-shadow: 0 0 0 1px #fff, 0 0 0 0.25rem { ToHex( Lighten( Var( ThemeVariables.Color( "primary" ) ), 75f ) )};")
            .AppendLine("}");

            sb.Append($".form-range::-webkit-slider-thumb:active")
            .Append("{")
            .Append($"background-color: { ToHex( Lighten( Var( ThemeVariables.Color( "primary" ) ), 70f ) )};")
            .AppendLine("}");
        }
コード例 #16
0
        protected virtual void GenerateInputCheckEditStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb
            .Append(".form-check-input.is-valid:checked, .was-validated .form-check-input:valid:checked").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append(".form-check-input.is-valid, .was-validated .form-check-input:valid").Append("{")
            .Append($"border-color: {options.CheckColor};")
            .AppendLine("}");

            sb
            .Append(".form-check-input:checked").Append("{")
            .Append($"background-color: {options.CheckColor};")
            .Append($"border-color: {options.CheckColor};")
            .AppendLine("}");
        }
コード例 #17
0
        protected override void GenerateInputStyles(StringBuilder sb, Theme theme, ThemeInputOptions options)
        {
            sb.Append(".ant-form-item input").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".ant-input-group-addon:first-child").Append("{")
            .Append($"border-top-left-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .Append($"border-bottom-left-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".ant-input-group-addon:last-child").Append("{")
            .Append($"border-top-right-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .Append($"border-bottom-right-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".ant-select-selector, .ant-select-selector input").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )} !important;")
            .AppendLine("}");

            sb.Append(".ant-checkbox-inner").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            sb.Append(".ant-upload button").Append("{")
            .Append($"border-radius: {GetBorderRadius( theme, options?.BorderRadius, Var( ThemeVariables.BorderRadius ) )};")
            .AppendLine("}");

            if (!string.IsNullOrEmpty(options?.Color))
            {
                sb.Append(".ant-input").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");

                //sb.Append( $".input-group-text" ).Append( "{" )
                //    .Append( $"color: {options.Color};" )
                //    .AppendLine( "}" );

                sb.Append(".ant-select-selection-search-input").Append("{")
                .Append($"color: {options.Color};")
                .AppendLine("}");
            }

            if (!string.IsNullOrEmpty(options?.CheckColor))
            {
                GenerateInputCheckEditStyles(sb, theme, options);
            }

            if (!string.IsNullOrEmpty(options?.SliderColor))
            {
                GenerateInputSliderStyles(sb, theme, options);
            }

            if (!string.IsNullOrEmpty(theme.ColorOptions?.Primary))
            {
                sb
                .Append(".flatpickr-months .flatpickr-month:hover svg,")
                .Append(".flatpickr-months .flatpickr-next-month:hover svg,")
                .Append(".flatpickr-months .flatpickr-prev-month:hover svg")
                .Append("{")
                .Append($"fill: { Var( ThemeVariables.Color( "primary" ) )} !important;")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange, .flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus, .flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover, .flatpickr-day.selected.prevMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.endRange.prevMonthDay, .flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.nextMonthDay").Append("{")
                .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
                .Append($"border-color: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day:hover").Append("{")
                .Append($"background: { ToHex( Lighten( Var( ThemeVariables.Color( "primary" ) ), 90f ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1))").Append("{")
                .Append($"box-shadow: -10px 0 0 { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.today").Append("{")
                .Append($"border-color: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-day.today:hover").Append("{")
                .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
                .Append($"border-color: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-monthSelect-month:hover,.flatpickr-monthSelect-month:focus").Append("{")
                .Append($"background: { ToHex( Lighten( Var( ThemeVariables.Color( "primary" ) ), 90f ) )};")
                .AppendLine("}");

                sb
                .Append(".flatpickr-monthSelect-month.selected").Append("{")
                .Append($"background: { Var( ThemeVariables.Color( "primary" ) )};")
                .AppendLine("}");
            }
        }