Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Nesting #1

Open
k15a opened this issue Mar 11, 2017 · 1 comment
Open

Nesting #1

k15a opened this issue Mar 11, 2017 · 1 comment

Comments

@k15a
Copy link
Member

k15a commented Mar 11, 2017

elm-styled needs some way to select child items. I think the simplest solution would be a select function which takes a String as the selector and a List Rule.

header = styled div
    [ padding (rem 4)
    , select "h1"
        [ -- Styles for h1's which are children of the header
        ]
    , select "div > &"
        [ -- Styles if the header is a child of a div
        ]
    , select "> div"
        [ -- Styles for div's which are direct children of the header
        ]
    ]

This would mean we need to parse the selector and replace each & with the generated class or prepend the generated class if there is no & in the selector.

@k15a
Copy link
Member Author

k15a commented Mar 15, 2017

Added simple nesting in 10eb12a

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant