git.iko.soy/typeable/elm-ui
on master help sign in
bugfix: spacing and nearby elements shouldnt conflict.
65ffe91Matthew Griffith
src/Internal/Model.elm+14−6
@@ -1002,42 +1002,50 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
1002 case location of
1002 case location of
1003 Above ->
1003 Above ->
1004 String.join " "
1004 String.join " "
1005+ [
1005− [ Internal.Style.classes.any
1006+ Internal.Style.classes.nearby
1006 , Internal.Style.classes.single
1007 , Internal.Style.classes.single
1007 , Internal.Style.classes.above
1008 , Internal.Style.classes.above
1008 ]
1009 ]
1009
1010
1010 Below ->
1011 Below ->
1011 String.join " "
1012 String.join " "
1013+ [
1012− [ Internal.Style.classes.any
1014+ Internal.Style.classes.nearby
1013 , Internal.Style.classes.single
1015 , Internal.Style.classes.single
1014 , Internal.Style.classes.below
1016 , Internal.Style.classes.below
1015 ]
1017 ]
1016
1018
1017 OnRight ->
1019 OnRight ->
1018 String.join " "
1020 String.join " "
1021+ [
1019− [ Internal.Style.classes.any
1022+ Internal.Style.classes.nearby
1020 , Internal.Style.classes.single
1023 , Internal.Style.classes.single
1021 , Internal.Style.classes.onRight
1024 , Internal.Style.classes.onRight
1022 ]
1025 ]
1023
1026
1024 OnLeft ->
1027 OnLeft ->
1028+
1029+
1025 String.join " "
1030 String.join " "
1031+ [
1026− [ Internal.Style.classes.any
1032+ Internal.Style.classes.nearby
1027 , Internal.Style.classes.single
1033 , Internal.Style.classes.single
1028 , Internal.Style.classes.onLeft
1034 , Internal.Style.classes.onLeft
1029 ]
1035 ]
1030
1036
1031 InFront ->
1037 InFront ->
1032 String.join " "
1038 String.join " "
1039+ [
1033− [ Internal.Style.classes.any
1040+ Internal.Style.classes.nearby
1034 , Internal.Style.classes.single
1041 , Internal.Style.classes.single
1035 , Internal.Style.classes.inFront
1042 , Internal.Style.classes.inFront
1036 ]
1043 ]
1037
1044
1038 Behind ->
1045 Behind ->
1039 String.join " "
1046 String.join " "
1047+ [
1040− [ Internal.Style.classes.any
1048+ Internal.Style.classes.nearby
1041 , Internal.Style.classes.single
1049 , Internal.Style.classes.single
1042 , Internal.Style.classes.behind
1050 , Internal.Style.classes.behind
1043 ]
1051 ]
src/Internal/Style.elm+98−92
@@ -152,6 +152,7 @@ classes =
152 , seButton = "sbt"
152 , seButton = "sbt"
153
153
154 -- nearby elements
154 -- nearby elements
155+ , nearby = "nb"
155 , above = "a"
156 , above = "a"
156 , below = "b"
157 , below = "b"
157 , onRight = "or"
158 , onRight = "or"
@@ -824,6 +825,103 @@ baseSheet =
824 ]
825 ]
825 ]
826 ]
826 ]
827 ]
828+ , Class (dot classes.nearby)
829+ [ Prop "position" "relative"
830+ , Prop "border" "none"
831+ , Prop "display" "flex"
832+ , Prop "flex-direction" "row"
833+ , Prop "flex-basis" "auto"
834+ , Batch <|
835+ (\fn -> List.map fn locations) <|
836+ \loc ->
837+ case loc of
838+ Above ->
839+ Descriptor (dot classes.above)
840+ [ Prop "position" "absolute"
841+ , Prop "bottom" "100%"
842+ , Prop "left" "0"
843+ , Prop "width" "100%"
844+ , Prop "z-index" "10"
845+ , Prop "margin" "0 !important"
846+ , Child (dot classes.heightFill)
847+ [ Prop "height" "auto"
848+ ]
849+ , Child (dot classes.widthFill)
850+ [ Prop "width" "100%"
851+ ]
852+ , Prop "pointer-events" "none"
853+ , Child (dot classes.any)
854+ [ Prop "pointer-events" "auto"
855+ ]
856+ ]
857+
858+ Below ->
859+ Descriptor (dot classes.below)
860+ [ Prop "position" "absolute"
861+ , Prop "bottom" "0"
862+ , Prop "left" "0"
863+ , Prop "height" "0"
864+ , Prop "width" "100%"
865+ , Prop "z-index" "10"
866+ , Prop "margin" "0 !important"
867+ , Prop "pointer-events" "auto"
868+ , Child (dot classes.heightFill)
869+ [ Prop "height" "auto"
870+ ]
871+ ]
872+
873+ OnRight ->
874+ Descriptor (dot classes.onRight)
875+ [ Prop "position" "absolute"
876+ , Prop "left" "100%"
877+ , Prop "top" "0"
878+ , Prop "height" "100%"
879+ , Prop "margin" "0 !important"
880+ , Prop "z-index" "10"
881+ , Prop "pointer-events" "auto"
882+ ]
883+
884+ OnLeft ->
885+ Descriptor (dot classes.onLeft)
886+ [ Prop "position" "absolute"
887+ , Prop "right" "100%"
888+ , Prop "top" "0"
889+ , Prop "height" "100%"
890+ , Prop "margin" "0 !important"
891+ , Prop "z-index" "10"
892+ , Prop "pointer-events" "auto"
893+ ]
894+
895+ Within ->
896+ Descriptor (dot classes.inFront)
897+ [ Prop "position" "absolute"
898+ , Prop "width" "100%"
899+ , Prop "height" "100%"
900+ , Prop "left" "0"
901+ , Prop "top" "0"
902+ , Prop "margin" "0 !important"
903+ , Prop "z-index" "10"
904+ , Prop "pointer-events" "none"
905+ , Child (dot classes.any)
906+ [ Prop "pointer-events" "auto"
907+ ]
908+ ]
909+
910+ Behind ->
911+ Descriptor (dot classes.behind)
912+ [ Prop "position" "absolute"
913+ , Prop "width" "100%"
914+ , Prop "height" "100%"
915+ , Prop "left" "0"
916+ , Prop "top" "0"
917+ , Prop "margin" "0 !important"
918+ , Prop "z-index" "0"
919+ , Prop "pointer-events" "none"
920+ , Child (dot classes.any)
921+ [ Prop "pointer-events" "auto"
922+ ]
923+ ]
924+ ]
827 , Class (dot classes.any)
925 , Class (dot classes.any)
828 [ Prop "position" "relative"
926 [ Prop "position" "relative"
829 , Prop "border" "none"
927 , Prop "border" "none"
@@ -844,8 +942,6 @@ baseSheet =
844 , Prop "font-size" "inherit"
942 , Prop "font-size" "inherit"
845 , Prop "color" "inherit"
943 , Prop "color" "inherit"
846 , Prop "font-family" "inherit"
944 , Prop "font-family" "inherit"
847−
848− -- , Prop "line-height" "inherit"
849 , Prop "line-height" "1"
945 , Prop "line-height" "1"
850 , Prop "font-weight" "inherit"
946 , Prop "font-weight" "inherit"
851
947
@@ -1465,96 +1561,6 @@ baseSheet =
1465 , Descriptor ".hidden"
1561 , Descriptor ".hidden"
1466 [ Prop "display" "none"
1562 [ Prop "display" "none"
1467 ]
1563 ]
1468− , Batch <|
1469− (\fn -> List.map fn locations) <|
1470− \loc ->
1471− case loc of
1472− Above ->
1473− Descriptor (dot classes.above)
1474− [ Prop "position" "absolute"
1475− , Prop "bottom" "100%"
1476− , Prop "left" "0"
1477− , Prop "width" "100%"
1478− , Prop "z-index" "10"
1479− , Prop "margin" "0 !important"
1480− , Child (dot classes.heightFill)
1481− [ Prop "height" "auto"
1482− ]
1483− , Child (dot classes.widthFill)
1484− [ Prop "width" "100%"
1485− ]
1486− , Prop "pointer-events" "none"
1487− , Child (dot classes.any)
1488− [ Prop "pointer-events" "auto"
1489− ]
1490− ]
1491−
1492− Below ->
1493− Descriptor (dot classes.below)
1494− [ Prop "position" "absolute"
1495− , Prop "bottom" "0"
1496− , Prop "left" "0"
1497− , Prop "height" "0"
1498− , Prop "width" "100%"
1499− , Prop "z-index" "10"
1500− , Prop "margin" "0 !important"
1501− , Prop "pointer-events" "auto"
1502− , Child (dot classes.heightFill)
1503− [ Prop "height" "auto"
1504− ]
1505− ]
1506−
1507− OnRight ->
1508− Descriptor (dot classes.onRight)
1509− [ Prop "position" "absolute"
1510− , Prop "left" "100%"
1511− , Prop "top" "0"
1512− , Prop "height" "100%"
1513− , Prop "margin" "0 !important"
1514− , Prop "z-index" "10"
1515− , Prop "pointer-events" "auto"
1516− ]
1517−
1518− OnLeft ->
1519− Descriptor (dot classes.onLeft)
1520− [ Prop "position" "absolute"
1521− , Prop "right" "100%"
1522− , Prop "top" "0"
1523− , Prop "height" "100%"
1524− , Prop "margin" "0 !important"
1525− , Prop "z-index" "10"
1526− , Prop "pointer-events" "auto"
1527− ]
1528−
1529− Within ->
1530− Descriptor (dot classes.inFront)
1531− [ Prop "position" "absolute"
1532− , Prop "width" "100%"
1533− , Prop "height" "100%"
1534− , Prop "left" "0"
1535− , Prop "top" "0"
1536− , Prop "margin" "0 !important"
1537− , Prop "z-index" "10"
1538− , Prop "pointer-events" "none"
1539− , Child (dot classes.any)
1540− [ Prop "pointer-events" "auto"
1541− ]
1542− ]
1543−
1544− Behind ->
1545− Descriptor (dot classes.behind)
1546− [ Prop "position" "absolute"
1547− , Prop "width" "100%"
1548− , Prop "height" "100%"
1549− , Prop "left" "0"
1550− , Prop "top" "0"
1551− , Prop "margin" "0 !important"
1552− , Prop "z-index" "0"
1553− , Prop "pointer-events" "none"
1554− , Child (dot classes.any)
1555− [ Prop "pointer-events" "auto"
1556− ]
1557− ]
1558 , Descriptor (dot classes.textThin)
1564 , Descriptor (dot classes.textThin)
1559 [ Prop "font-weight" "100"
1565 [ Prop "font-weight" "100"
1560 ]
1566 ]