Skip to content

Commit 97e2974

Browse files
author
Richard Feldman
committed
wip
1 parent 3dd3c41 commit 97e2974

File tree

3 files changed

+98
-30
lines changed

3 files changed

+98
-30
lines changed

examples/src/Homepage.css.elm

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
module HomepageStylesheet where
2+
3+
import Stylesheets exposing (..)
4+
import SharedStyles exposing (..)
5+
6+
7+
port css : String
8+
port css =
9+
Stylesheets.prettyPrint 4 <|
10+
stylesheet
11+
12+
|.| HeaderLinks |.| Footer |#| FootnotesDebug
13+
14+
|%| header />/ stuff
15+
16+
17+
|%| header /:/ hover
18+
|-| doStuff bar
19+
|-| doStuff bar
20+
21+
22+
|%| header />/ stuff
23+
|%| header />>/ stuff
24+
|-| backgroundColor (rgb 90 90 90)
25+
|-| boxSizing borderBox
26+
|-| padding 12 px
27+
28+
|%| nav
29+
|-| display inlineBlock
30+
|-| paddingBottom 12 px
31+
32+
|.| NavLink
33+
|-| margin 12 px
34+
|-| color (rgb 255 255 255)
35+
36+
|#| ReactiveLogo
37+
|-| display inlineBlock
38+
|-| marginLeft 150 px
39+
|-| marginRight 80 px
40+
|-| verticalAlign middle
41+
42+
|#| BuyTickets
43+
|-| padding 16 px
44+
|-| paddingLeft 24 px
45+
|-| paddingRight 24 px
46+
|-| marginLeft 50 px
47+
|-| color (rgb 255 255 255)
48+
|-| backgroundColor (rgb 27 217 130)
49+
|-| verticalAlign middle

examples/src/HomepageStylesheet.elm

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
module HomepageStylesheet where
1+
module HomepageStylesheet (..) where
22

33
import Stylesheets exposing (..)
44
import SharedStyles exposing (..)
55

66

77
port css : String
88
port css =
9-
Stylesheets.prettyPrint 4 <|
10-
stylesheet
11-
|%| header
12-
|-| backgroundColor (rgb 90 90 90)
13-
|-| boxSizing borderBox
14-
|-| padding 12 px
15-
16-
|%| nav
17-
|-| display inlineBlock
18-
|-| paddingBottom 12 px
19-
20-
|.| NavLink
21-
|-| margin 12 px
22-
|-| color (rgb 255 255 255)
23-
24-
|#| ReactiveLogo
25-
|-| display inlineBlock
26-
|-| marginLeft 150 px
27-
|-| marginRight 80 px
28-
|-| verticalAlign middle
29-
30-
|#| BuyTickets
31-
|-| padding 16 px
32-
|-| paddingLeft 24 px
33-
|-| paddingRight 24 px
34-
|-| marginLeft 50 px
35-
|-| color (rgb 255 255 255)
36-
|-| backgroundColor (rgb 27 217 130)
37-
|-| verticalAlign middle
9+
Stylesheets.prettyPrint 4
10+
<| stylesheet
11+
|.| HeaderLinks
12+
|.| Footer
13+
|#| FootnotesDebug
14+
|%| header
15+
/>/ stuff
16+
|-| backgroundColor (rgb 90 90 90)
17+
|-| boxSizing borderBox
18+
|-| padding 12 px
19+
|%| nav
20+
|-| display inlineBlock
21+
|-| paddingBottom 12 px
22+
|.| NavLink
23+
|-| margin 12 px
24+
|-| color (rgb 255 255 255)
25+
|#| ReactiveLogo
26+
|-| display inlineBlock
27+
|-| marginLeft 150 px
28+
|-| marginRight 80 px
29+
|-| verticalAlign middle
30+
|#| BuyTickets
31+
|-| padding 16 px
32+
|-| paddingLeft 24 px
33+
|-| paddingRight 24 px
34+
|-| marginLeft 50 px
35+
|-| color (rgb 255 255 255)
36+
|-| backgroundColor (rgb 27 217 130)
37+
|-| verticalAlign middle

src/Stylesheets.elm

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,25 @@ styleWithPrefix prefix (Style selector attrs children) childSelector =
485485
children ++ [ Style (tagToString tag) [] [] ]
486486
|> Style selector attrs
487487

488+
{-| Specify that one selector is a descendant of another.
489+
490+
In CSS, this has historically been done without an operator
491+
(e.g. `form input { color: "#ff0000" }`) although the proposed
492+
[CSS4 descendant combinator `>>`](https://drafts.csswg.org/selectors-4/#descendant-combinators)
493+
would allow for explicitly declaring the relationship
494+
(e.g. `form >> input { color: "#ff0000" }`)
495+
496+
The />>/ operator works like the proposed `>>` in CSS4:
497+
498+
|%| form />>/ input
499+
|-| color (hex "ff0000")
500+
501+
-- CSS equivalent: form input { color: "#ff0000" }
502+
503+
To use this with classes and ids instead of tags (e.g. `form .field { color: "#ff0000" }`),
504+
see />>./ and />>#/
505+
-}
506+
(/>>/)
488507

489508
(|%|=) : Style class id -> List Tag -> Style class id
490509
(|%|=) (Style selector attrs children) tags =

0 commit comments

Comments
 (0)