git.iko.soy/typeable/elm-ui
on master help sign in
bugfix: nearby els(below) were being picked up by the spacing selector.
9ae3d13Matthew Griffith
src/Internal/Style.elm+93−87
@@ -792,6 +792,96 @@ rules =
792 ++ renderCompact (baseSheet ++ commonValues)
792 ++ renderCompact (baseSheet ++ commonValues)
793
793
794
794
795+elDescription =
796+ [ Prop "display" "flex"
797+ , Prop "flex-direction" "column"
798+ , Prop "white-space" "pre"
799+ , Descriptor (dot classes.hasBehind)
800+ [ Prop "z-index" "0"
801+ , Child (dot classes.behind)
802+ [ Prop "z-index" "-1"
803+ ]
804+ ]
805+ , Descriptor (dot classes.seButton)
806+ -- Special default for text in a button.
807+ -- This is overridden is they put the text inside an `el`
808+ [ Child (dot classes.text)
809+ [ Descriptor (dot classes.heightFill)
810+ [ Prop "flex-grow" "0"
811+ ]
812+ , Descriptor (dot classes.widthFill)
813+ [ Prop "align-self" "auto !important"
814+ ]
815+ ]
816+ ]
817+ , Child (dot classes.heightContent)
818+ [ Prop "height" "auto"
819+ ]
820+ , Child (dot classes.heightFill)
821+ [ Prop "flex-grow" "100000"
822+ ]
823+ , Child (dot classes.widthFill)
824+ [ -- alignLeft, alignRight, centerX are overridden by width.
825+ -- Prop "align-self" "stretch !important"
826+ Prop "width" "100%"
827+ ]
828+ , Child (dot classes.widthContent)
829+ [ Prop "align-self" "flex-start"
830+ ]
831+
832+ -- , Child (dot classes.widthFill)
833+ -- [ Prop "align-self" "stretch"
834+ -- , Descriptor (dot classes.alignedHorizontally)
835+ -- [ Prop "width" "100%"
836+ -- ]
837+ -- ]
838+ , describeAlignment <|
839+ \alignment ->
840+ case alignment of
841+ Top ->
842+ ( [ Prop "justify-content" "flex-start" ]
843+ , [ Prop "margin-bottom" "auto !important"
844+ , Prop "margin-top" "0 !important"
845+ ]
846+ )
847+
848+ Bottom ->
849+ ( [ Prop "justify-content" "flex-end" ]
850+ , [ Prop "margin-top" "auto !important"
851+ , Prop "margin-bottom" "0 !important"
852+ ]
853+ )
854+
855+ Right ->
856+ ( [ Prop "align-items" "flex-end" ]
857+ , [ Prop "align-self" "flex-end" ]
858+ )
859+
860+ Left ->
861+ ( [ Prop "align-items" "flex-start" ]
862+ , [ Prop "align-self" "flex-start" ]
863+ )
864+
865+ CenterX ->
866+ ( [ Prop "align-items" "center" ]
867+ , [ Prop "align-self" "center"
868+ ]
869+ )
870+
871+ CenterY ->
872+ ( [ -- Prop "justify-content" "center"
873+ Child (dot classes.any)
874+ [ Prop "margin-top" "auto"
875+ , Prop "margin-bottom" "auto"
876+ ]
877+ ]
878+ , [ Prop "margin-top" "auto !important"
879+ , Prop "margin-bottom" "auto !important"
880+ ]
881+ )
882+ ]
883+
884+
795baseSheet =
885baseSheet =
796 [ Class "html,body"
886 [ Class "html,body"
797 [ Prop "height" "100%"
887 [ Prop "height" "100%"
@@ -831,6 +921,8 @@ baseSheet =
831 , Prop "display" "flex"
921 , Prop "display" "flex"
832 , Prop "flex-direction" "row"
922 , Prop "flex-direction" "row"
833 , Prop "flex-basis" "auto"
923 , Prop "flex-basis" "auto"
924+ , Descriptor (dot classes.single)
925+ elDescription
834 , Batch <|
926 , Batch <|
835 (\fn -> List.map fn locations) <|
927 (\fn -> List.map fn locations) <|
836 \loc ->
928 \loc ->
@@ -1060,93 +1152,7 @@ baseSheet =
1060 [ Prop "line-height" "1.05"
1152 [ Prop "line-height" "1.05"
1061 ]
1153 ]
1062 , Descriptor (dot classes.single)
1154 , Descriptor (dot classes.single)
1063− [ Prop "display" "flex"
1155+ elDescription
1064− , Prop "flex-direction" "column"
1065− , Prop "white-space" "pre"
1066− , Descriptor (dot classes.hasBehind)
1067− [ Prop "z-index" "0"
1068− , Child (dot classes.behind)
1069− [ Prop "z-index" "-1"
1070− ]
1071− ]
1072− , Descriptor (dot classes.seButton)
1073− -- Special default for text in a button.
1074− -- This is overridden is they put the text inside an `el`
1075− [ Child (dot classes.text)
1076− [ Descriptor (dot classes.heightFill)
1077− [ Prop "flex-grow" "0"
1078− ]
1079− , Descriptor (dot classes.widthFill)
1080− [ Prop "align-self" "auto !important"
1081− ]
1082− ]
1083− ]
1084− , Child (dot classes.heightContent)
1085− [ Prop "height" "auto"
1086− ]
1087− , Child (dot classes.heightFill)
1088− [ Prop "flex-grow" "100000"
1089− ]
1090− , Child (dot classes.widthFill)
1091− [ -- alignLeft, alignRight, centerX are overridden by width.
1092− -- Prop "align-self" "stretch !important"
1093− Prop "width" "100%"
1094− ]
1095− , Child (dot classes.widthContent)
1096− [ Prop "align-self" "flex-start"
1097− ]
1098−
1099− -- , Child (dot classes.widthFill)
1100− -- [ Prop "align-self" "stretch"
1101− -- , Descriptor (dot classes.alignedHorizontally)
1102− -- [ Prop "width" "100%"
1103− -- ]
1104− -- ]
1105− , describeAlignment <|
1106− \alignment ->
1107− case alignment of
1108− Top ->
1109− ( [ Prop "justify-content" "flex-start" ]
1110− , [ Prop "margin-bottom" "auto !important"
1111− , Prop "margin-top" "0 !important"
1112− ]
1113− )
1114−
1115− Bottom ->
1116− ( [ Prop "justify-content" "flex-end" ]
1117− , [ Prop "margin-top" "auto !important"
1118− , Prop "margin-bottom" "0 !important"
1119− ]
1120− )
1121−
1122− Right ->
1123− ( [ Prop "align-items" "flex-end" ]
1124− , [ Prop "align-self" "flex-end" ]
1125− )
1126−
1127− Left ->
1128− ( [ Prop "align-items" "flex-start" ]
1129− , [ Prop "align-self" "flex-start" ]
1130− )
1131−
1132− CenterX ->
1133− ( [ Prop "align-items" "center" ]
1134− , [ Prop "align-self" "center"
1135− ]
1136− )
1137−
1138− CenterY ->
1139− ( [ -- Prop "justify-content" "center"
1140− Child (dot classes.any)
1141− [ Prop "margin-top" "auto"
1142− , Prop "margin-bottom" "auto"
1143− ]
1144− ]
1145− , [ Prop "margin-top" "auto !important"
1146− , Prop "margin-bottom" "auto !important"
1147− ]
1148− )
1149− ]
1150 , Descriptor (dot classes.row)
1156 , Descriptor (dot classes.row)
1151 [ Prop "display" "flex"
1157 [ Prop "display" "flex"
1152 , Prop "flex-direction" "row"
1158 , Prop "flex-direction" "row"