Skip to content

Nested rulesΒ #153

@nsaunders

Description

@nsaunders

I was experimenting a bit with Clay today and found that it allows a nested selector to reference its parent, similar to & in languages like Sass and LESS.

Examples

Nested "self" with refinement

main = do
  putCss $ do
    star # byClass "foo" ? do
      byClass "bar" & do
        width nil

yields

.bar.foo
{
  width : 0;
}

Nested child

main = do
  putCss $ do
    star # byClass "foo" ? do
      star # byClass "bar" <? do
        width nil

yields

.foo > .bar
{
  width : 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions