git.iko.soy/typeable/elm-ui
on master help sign in
bugfix: spacing and nearby elements shouldnt conflict.
commit65ffe91e0fd7df68cb555171ca6fc44afe9e002d authorMatthew Griffith <mdg.griffith@gmail.com> dateSun 9 Sep 2018, 08:31 (8 years ago) parent7e99508
2 files changed+112−98
src/Internal/Model.elm+14−6 src/Internal/Style.elm+98−92
src/Internal/Model.elm+14−6
@@ -1002,42 +1002,50 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
10021002 case location of
10031003 Above ->
10041004 String.join " "
1005− [ Internal.Style.classes.any
1005+ [
1006+ Internal.Style.classes.nearby
10061007 , Internal.Style.classes.single
10071008 , Internal.Style.classes.above
10081009 ]
10091010
10101011 Below ->
10111012 String.join " "
1012− [ Internal.Style.classes.any
1013+ [
1014+ Internal.Style.classes.nearby
10131015 , Internal.Style.classes.single
10141016 , Internal.Style.classes.below
10151017 ]
10161018
10171019 OnRight ->
10181020 String.join " "
1019− [ Internal.Style.classes.any
1021+ [
1022+ Internal.Style.classes.nearby
10201023 , Internal.Style.classes.single
10211024 , Internal.Style.classes.onRight
10221025 ]
10231026
10241027 OnLeft ->
1028+
1029+
10251030 String.join " "
1026− [ Internal.Style.classes.any
1031+ [
1032+ Internal.Style.classes.nearby
10271033 , Internal.Style.classes.single
10281034 , Internal.Style.classes.onLeft
10291035 ]
10301036
10311037 InFront ->
10321038 String.join " "
1033− [ Internal.Style.classes.any
1039+ [
1040+ Internal.Style.classes.nearby
10341041 , Internal.Style.classes.single
10351042 , Internal.Style.classes.inFront
10361043 ]
10371044
10381045 Behind ->
10391046 String.join " "
1040− [ Internal.Style.classes.any
1047+ [
1048+ Internal.Style.classes.nearby
10411049 , Internal.Style.classes.single
10421050 , Internal.Style.classes.behind
10431051 ]
src/Internal/Style.elm+98−92
@@ -152,6 +152,7 @@ classes =
152152 , seButton = "sbt"
153153
154154 -- nearby elements
155+ , nearby = "nb"
155156 , above = "a"
156157 , below = "b"
157158 , onRight = "or"
@@ -824,6 +825,103 @@ baseSheet =
824825 ]
825826 ]
826827 ]
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+ ]
827925 , Class (dot classes.any)
828926 [ Prop "position" "relative"
829927 , Prop "border" "none"
@@ -844,8 +942,6 @@ baseSheet =
844942 , Prop "font-size" "inherit"
845943 , Prop "color" "inherit"
846944 , Prop "font-family" "inherit"
847−
848− -- , Prop "line-height" "inherit"
849945 , Prop "line-height" "1"
850946 , Prop "font-weight" "inherit"
851947
@@ -1465,96 +1561,6 @@ baseSheet =
14651561 , Descriptor ".hidden"
14661562 [ Prop "display" "none"
14671563 ]
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− ]
15581564 , Descriptor (dot classes.textThin)
15591565 [ Prop "font-weight" "100"
15601566 ]