@@ -26,10 +26,15 @@ PUNICA CSS > ELEMENTS : FORM *************************/
2626 outline-offset : - $form-outline-width ;
2727 transition : .35s ;
2828 }
29- @each $style-name , $style-color in $form-input-styles {
30- & .#{$style-name } {
31- color : $style-color ;
32- outline-color : $style-color ;
29+ //
30+ // VALIDATION STYLES
31+ //
32+ @if $elements-form-validation-styles {
33+ @each $style-name , $style-color in $form-input-styles {
34+ & .#{$style-name } {
35+ color : $style-color ;
36+ outline-color : $style-color ;
37+ }
3338 }
3439 }
3540 };
@@ -94,36 +99,40 @@ PUNICA CSS > ELEMENTS : FORM *************************/
9499 height : 100% ;
95100 cursor : default ;
96101 }
97- // form group
98- @at-root .#{$form-name } .#{$form-group } ,
99- & >.#{$form-group } {
100- display : flex ;
101- width : 100% ;
102- >* {
103- flex : 1 1 auto ;
104- & :last-child {
105- margin-left : -1px ;
102+ //
103+ // FORM GROUPS
104+ //
105+ @if $elements-form-group {
106+ @at-root .#{$form-name } .#{$form-group } ,
107+ & >.#{$form-group } {
108+ display : flex ;
109+ width : 100% ;
110+ >* {
111+ flex : 1 1 auto ;
112+ & :last-child {
113+ margin-left : -1px ;
114+ }
115+ & :not (:first-child ):not (:last-child ) {
116+ margin-left : -1px ;
117+ margin-right : 0 ;
118+ }
106119 }
107- & :not (:first-child ):not (:last-child ) {
108- margin-left : -1px ;
109- margin-right : 0 ;
120+ >.#{$button-class-group } {
121+ box-shadow : none ;
110122 }
111- }
112- >.#{$button-class-group } {
113- box-shadow : none ;
114- }
115- >.#{$button-class } {
116- height : $form-input-height ;
117- font-size : $button-font-size ;
118- padding : $button-padding ;
119- font-weight : $button-font-weight ;
120- & :first-child {
121- border-bottom-right-radius : 0 ;
122- border-top-right-radius : 0 ;
123- }
124- & :last-child:not (:first-child ) {
125- border-bottom-left-radius : 0 ;
126- border-top-left-radius : 0 ;
123+ >.#{$button-class } {
124+ height : $form-input-height ;
125+ font-size : $button-font-size ;
126+ padding : $button-padding ;
127+ font-weight : $button-font-weight ;
128+ & :first-child {
129+ border-bottom-right-radius : 0 ;
130+ border-top-right-radius : 0 ;
131+ }
132+ & :last-child:not (:first-child ) {
133+ border-bottom-left-radius : 0 ;
134+ border-top-left-radius : 0 ;
135+ }
127136 }
128137 }
129138 }
@@ -150,79 +159,88 @@ PUNICA CSS > ELEMENTS : FORM *************************/
150159 }
151160 }
152161 }
153- // input sizes
154- @each $size-name , $font-size , $input-height , $button-padding , $button-font-size in $form-input-sizes {
155- & .#{$size-name } {
156- @include form-inputs () {
157- height : $input-height ;
158- font-size : $font-size ;
159- }
160- .#{$button-class } {
161- height : $input-height !important ;
162- font-size : $button-font-size !important ;
163- padding : $button-padding !important ;
164- }
165- @at-root .#{$form-name } .#{$size-name } label ,
166- & >.#{$form-items } >.#{$form-item } >label ,
167- & >.#{$form-item } >label {
168- font-size : $font-size ;
162+ //
163+ // INPUT SIZES
164+ //
165+ @if $elements-form-input-sizes {
166+ @each $size-name , $font-size , $input-height , $button-padding , $button-font-size in $form-input-sizes {
167+ & .#{$size-name } {
168+ @include form-inputs () {
169+ height : $input-height ;
170+ font-size : $font-size ;
171+ }
172+ .#{$button-class } {
173+ height : $input-height !important ;
174+ font-size : $button-font-size !important ;
175+ padding : $button-padding !important ;
176+ }
177+ @at-root .#{$form-name } .#{$size-name } label ,
178+ & >.#{$form-items } >.#{$form-item } >label ,
179+ & >.#{$form-item } >label {
180+ font-size : $font-size ;
181+ }
169182 }
170183 }
171184 }
172185 }
173- .#{$form-radio } ,
174- .#{$form-checkbox } {
175- position : relative ;
176- label {
177- padding : $form-checkbox-label-padding ;
178- cursor : pointer ;
179- user-select : none ;
180- font-weight : 400 ;
181- margin : 0 ;
182- }
183- input {
184- left : 0 ;
185- opacity : 0 ;
186- position : absolute ;
187- top : 0 ;
188- }
189- input + label ::before ,
190- input + label ::after {
191- position : absolute ;
192- transition : opacity 0.11s ease-in-out ;
193- font-family : $form-icon-font-family ;
194- font-style : normal ;
195- font-weight : normal ;
196- text-transform : none ;
197- color : $form-radio-checkbox-color ;
198- font-size : $form-radio-checkbox-size ;
199- top : $form-radio-checkbox-top ;
200- left : $form-radio-checkbox-left ;
201- }
202- input + label ::before {
203- opacity : 1 ;
204- }
205- input + label ::after {
206- opacity : 0 ;
207- }
208- input :checked + label ::after {
209- opacity : 1 ;
210- }
211- }
212- .#{$form-checkbox } {
213- input + label ::before {
214- content : $form-checkbox-before-content ;
215- }
216- input + label ::after {
217- content : $form-checkbox-after-content ;
186+ //
187+ // CHECKBOX & RADIO
188+ //
189+ @if $elements-form-checkbox-radio {
190+ .#{$form-radio } ,
191+ .#{$form-checkbox } {
192+ position : relative ;
193+ label {
194+ padding : $form-checkbox-label-padding ;
195+ cursor : pointer ;
196+ user-select : none ;
197+ font-weight : 400 ;
198+ margin : 0 ;
199+ }
200+ input {
201+ left : 0 ;
202+ opacity : 0 ;
203+ position : absolute ;
204+ top : 0 ;
205+ }
206+ input + label ::before ,
207+ input + label ::after {
208+ position : absolute ;
209+ transition : opacity 0.11s ease-in-out ;
210+ font-family : $form-icon-font-family ;
211+ font-style : normal ;
212+ font-weight : normal ;
213+ text-transform : none ;
214+ color : $form-radio-checkbox-color ;
215+ font-size : $form-radio-checkbox-size ;
216+ top : $form-radio-checkbox-top ;
217+ left : $form-radio-checkbox-left ;
218+ }
219+ input + label ::before {
220+ opacity : 1 ;
221+ }
222+ input + label ::after {
223+ opacity : 0 ;
224+ }
225+ input :checked + label ::after {
226+ opacity : 1 ;
227+ }
218228 }
219- }
220- .#{$form-radio } {
221- input + label ::before {
222- content : $form-radio-before-content ;
229+ .#{$form-checkbox } {
230+ input + label ::before {
231+ content : $form-checkbox-before-content ;
232+ }
233+ input + label ::after {
234+ content : $form-checkbox-after-content ;
235+ }
223236 }
224- input + label ::after {
225- content : $form-radio-after-content ;
237+ .#{$form-radio } {
238+ input + label ::before {
239+ content : $form-radio-before-content ;
240+ }
241+ input + label ::after {
242+ content : $form-radio-after-content ;
243+ }
226244 }
227245 }
228246}
0 commit comments