@@ -190,9 +190,9 @@ input[type="radio"]+label:before {
190190 margin-right : 0.5em ;
191191 font-size : 1.5em ;
192192 line-height : 1 ;
193- display : block;
194193 width : 1em ;
195194 height : 1em ;
195+ display : block;
196196 transform : scale ( 1 ) ;
197197 transition : transform 0.05s ease-in-out;
198198}
@@ -224,7 +224,7 @@ input[type="radio"]:active+label:before {
224224
225225input [type = "checkbox" ]: checked + label ,
226226input [type = "radio" ]: checked + label {
227- color : rgb ( var ( --form-checkbox-radio-chcked -label ) ) ;
227+ color : rgb ( var ( --form-checkbox-radio-checked -label ) ) ;
228228}
229229
230230input [type = "checkbox" ]: not ( [disabled ]) : hover : checked + label ,
@@ -758,6 +758,238 @@ input[type="range"][disabled]~.input-helper {
758758}
759759
760760/* form variants */
761+ . form-grid-wrap {
762+ padding : 0.5em 0 ;
763+ position : relative;
764+ width : 100% ;
765+ }
766+
767+ . form-grid-wrap . input-helper : not ( : only-child ) {
768+ padding-top : 0.5em ;
769+ }
770+
771+ . form-grid {
772+ padding : calc ( var ( --layout-line-width ) * 2 ) ;
773+ display : grid;
774+ border-radius : calc ( var ( --layout-line-width ) * 6 ) ;
775+ border-width : var ( --layout-line-width ) ;
776+ border-style : solid;
777+ border-color : rgb ( var ( --form-checkbox-radio-label ) ) ;
778+ transition : all var ( --layout-transition-speed-fast ) ease-in-out;
779+ }
780+
781+ . form-grid : focus ,
782+ . form-grid : focus-within {
783+ outline : 0 ;
784+ border-color : rgb ( var ( --theme-style-text ) ) ;
785+ }
786+
787+ . form-grid [disabled ] {
788+ border-color : rgb ( var ( --form-checkbox-radio-disabled-label ) ) ;
789+ }
790+
791+ . form-grid [disabled ]+ . input-helper {
792+ color : rgb ( var ( --form-input-text-disabled-helper-text ) ) ;
793+ }
794+
795+ . form-grid [disabled ]: focus ,
796+ . form-grid [disabled ]: focus-within {
797+ border-color : rgb ( var ( --form-checkbox-radio-disabled-label ) ) ;
798+ }
799+
800+ . form-grid-3x3 {
801+ grid-template-columns : repeat ( 3 , 1fr ) ;
802+ grid-template-rows : repeat ( 3 , 1fr ) ;
803+ }
804+
805+ . form-grid-3x1 {
806+ grid-template-columns : repeat ( 3 , 1fr ) ;
807+ }
808+
809+ . form-grid-square {
810+ width : 7em ;
811+ height : 7em ;
812+ }
813+
814+ . form-grid-rectangle {
815+ width : 7em ;
816+ height : 3em ;
817+ }
818+
819+ . form-grid-viewport {
820+ width : 12vw ;
821+ height : 12vh ;
822+ min-width : 5em ;
823+ min-height : 5em ;
824+ }
825+
826+ . form-grid . input-wrap {
827+ padding : 0 ;
828+ }
829+
830+ . form-grid input [type = "checkbox" ]+ label ,
831+ . form-grid input [type = "radio" ]+ label {
832+ display : block;
833+ width : 100% ;
834+ height : 100% ;
835+ border-width : calc ( var ( --layout-line-width ) / 2 ) ;
836+ border-style : solid;
837+ border-color : transparent;
838+ position : relative;
839+ transition : none;
840+ }
841+
842+ . form-grid input [type = "checkbox" ]: focus + label ,
843+ . form-grid input [type = "checkbox" ]: hover + label ,
844+ . form-grid input [type = "radio" ]: focus + label ,
845+ . form-grid input [type = "radio" ]: hover + label {
846+ border-color : rgb ( var ( --theme-style-text ) ) ;
847+ }
848+
849+ . form-grid input [type = "checkbox" ]: active + label ,
850+ . form-grid input [type = "radio" ]: active + label {
851+ border-color : rgb ( var ( --theme-accent ) ) ;
852+ }
853+
854+ . form-grid input [type = "checkbox" ]: checked + label ,
855+ . form-grid input [type = "radio" ]: checked + label {
856+ border-color : rgb ( var ( --theme-accent ) ) ;
857+ }
858+
859+ . form-grid input [type = "checkbox" ][disabled ]: focus + label ,
860+ . form-grid input [type = "checkbox" ][disabled ]: hover + label ,
861+ . form-grid input [type = "radio" ][disabled ]: focus + label ,
862+ . form-grid input [type = "radio" ][disabled ]: hover + label {
863+ border-color : transparent;
864+ }
865+
866+ . form-grid input [type = "checkbox" ][disabled ]: active + label ,
867+ . form-grid input [type = "radio" ][disabled ]: active + label {
868+ border-color : transparent;
869+ }
870+
871+ . form-grid input [type = "checkbox" ][disabled ]: checked + label ,
872+ . form-grid input [type = "radio" ][disabled ]: checked + label {
873+ border-color : rgb ( var ( --form-checkbox-radio-disabled-label ) ) ;
874+ }
875+
876+ . form-grid input [type = "checkbox" ]: not ( [disabled ]) : hover : checked + label ,
877+ . form-grid input [type = "checkbox" ]: not ( [disabled ]) : focus : checked + label ,
878+ . form-grid input [type = "radio" ]: not ( [disabled ]) : hover : checked + label ,
879+ . form-grid input [type = "radio" ]: not ( [disabled ]) : focus : checked + label {
880+ border-color : rgb ( var ( --theme-accent ) ) ;
881+ }
882+
883+ . form-grid input [type = "checkbox" ]+ label : before ,
884+ . form-grid input [type = "radio" ]+ label : before {
885+ content : "" ;
886+ margin-right : 0 ;
887+ font-size : 1em ;
888+ /* margin: var(--layout-line-width); */
889+ width : inherit;
890+ height : inherit;
891+ width : calc ( 100% - calc ( var ( --layout-line-width ) * 4 ) ) ;
892+ height : calc ( 100% - calc ( var ( --layout-line-width ) * 4 ) ) ;
893+ position : absolute;
894+ top : calc ( var ( --layout-line-width ) * 2 ) ;
895+ left : calc ( var ( --layout-line-width ) * 2 ) ;
896+ display : block;
897+ transform : scale ( 1 ) ;
898+ transition : transform 0.05s ease-in-out;
899+ }
900+
901+ . form-grid input [type = "checkbox" ]: focus + label : before ,
902+ . form-grid input [type = "checkbox" ]: hover + label : before ,
903+ . form-grid input [type = "radio" ]: focus + label : before ,
904+ . form-grid input [type = "radio" ]: hover + label : before {
905+ transform : scale ( 1 ) ;
906+ }
907+
908+ . form-grid input [type = "checkbox" ]: checked + label : before ,
909+ . form-grid input [type = "radio" ]: checked + label : before {
910+ background-color : rgb ( var ( --theme-accent ) ) ;
911+ transform : scale ( 1 ) ;
912+ }
913+
914+ . form-grid input [type = "checkbox" ]: checked + label : before ,
915+ . form-grid input [type = "radio" ]: checked + label : before {
916+ background-color : rgb ( var ( --theme-accent ) ) ;
917+ }
918+
919+ . form-grid input [type = "checkbox" ][disabled ]+ label ,
920+ . form-grid input [type = "radio" ][disabled ]+ label {
921+ transform : scale ( 1 ) ;
922+ }
923+
924+ . form-grid input [type = "checkbox" ][disabled ]: checked + label : before ,
925+ . form-grid input [type = "radio" ][disabled ]: checked + label : before {
926+ background-color : rgb ( var ( --form-checkbox-radio-disabled-label ) ) ;
927+ }
928+
929+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 1 ) input [type = "checkbox" ]+ label ,
930+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 1 ) input [type = "radio" ]+ label {
931+ border-top-left-radius : calc ( var ( --layout-line-width ) * 3 ) ;
932+ }
933+
934+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 1 ) input [type = "checkbox" ]+ label : before ,
935+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 1 ) input [type = "radio" ]+ label : before {
936+ border-top-left-radius : var ( --layout-line-width ) ;
937+ }
938+
939+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 3 ) input [type = "checkbox" ]+ label ,
940+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 3 ) input [type = "radio" ]+ label {
941+ border-top-right-radius : calc ( var ( --layout-line-width ) * 3 ) ;
942+ }
943+
944+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 3 ) input [type = "checkbox" ]+ label : before ,
945+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 3 ) input [type = "radio" ]+ label : before {
946+ border-top-right-radius : var ( --layout-line-width ) ;
947+ }
948+
949+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 7 ) input [type = "checkbox" ]+ label ,
950+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 7 ) input [type = "radio" ]+ label {
951+ border-bottom-left-radius : calc ( var ( --layout-line-width ) * 3 ) ;
952+ }
953+
954+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 7 ) input [type = "checkbox" ]+ label : before ,
955+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 7 ) input [type = "radio" ]+ label : before {
956+ border-bottom-left-radius : var ( --layout-line-width ) ;
957+ }
958+
959+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 9 ) input [type = "checkbox" ]+ label ,
960+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 9 ) input [type = "radio" ]+ label {
961+ border-bottom-right-radius : calc ( var ( --layout-line-width ) * 3 ) ;
962+ }
963+
964+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 9 ) input [type = "checkbox" ]+ label : before ,
965+ . form-grid . form-grid-3x3 . input-wrap : nth-child ( 9 ) input [type = "radio" ]+ label : before {
966+ border-bottom-right-radius : var ( --layout-line-width ) ;
967+ }
968+
969+ . form-grid . form-grid-3x1 . input-wrap : nth-child ( 1 ) input [type = "checkbox" ]+ label ,
970+ . form-grid . form-grid-3x1 . input-wrap : nth-child ( 1 ) input [type = "radio" ]+ label {
971+ border-top-left-radius : calc ( var ( --layout-line-width ) * 3 ) ;
972+ border-bottom-left-radius : calc ( var ( --layout-line-width ) * 3 ) ;
973+ }
974+
975+ . form-grid . form-grid-3x1 . input-wrap : nth-child ( 1 ) input [type = "checkbox" ]+ label : before ,
976+ . form-grid . form-grid-3x1 . input-wrap : nth-child ( 1 ) input [type = "radio" ]+ label : before {
977+ border-top-left-radius : var ( --layout-line-width ) ;
978+ border-bottom-left-radius : var ( --layout-line-width ) ;
979+ }
980+
981+ . form-grid . form-grid-3x1 . input-wrap : nth-child ( 3 ) input [type = "checkbox" ]+ label ,
982+ . form-grid . form-grid-3x1 . input-wrap : nth-child ( 3 ) input [type = "radio" ]+ label {
983+ border-top-right-radius : calc ( var ( --layout-line-width ) * 3 ) ;
984+ border-bottom-right-radius : calc ( var ( --layout-line-width ) * 3 ) ;
985+ }
986+
987+ . form-grid . form-grid-3x1 . input-wrap : nth-child ( 3 ) input [type = "checkbox" ]+ label : before ,
988+ . form-grid . form-grid-3x1 . input-wrap : nth-child ( 3 ) input [type = "radio" ]+ label : before {
989+ border-top-right-radius : var ( --layout-line-width ) ;
990+ border-bottom-right-radius : var ( --layout-line-width ) ;
991+ }
992+
761993. form-indent {
762994 margin-left : 2.25em ;
763995}
0 commit comments