Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for a block of styles to mixins. #167

Closed
wants to merge 16 commits into from

Conversation

chriseppstein
Copy link

This patch allows passing a ruleset to mixins for placement by the new @children directive. It is useful when abstracting a concept associated with selectors or directives.

@canweriotnow
Copy link

Wow... I can already think of multiple use cases for my current project. Awesome!

@nheinrich
Copy link

FANTASTIC

@chriseppstein
Copy link
Author

Here's a gist where I first explored this concept. some of the comments there might be relevant: https://gist.github.com/407318

In particular, @hagenburger suggested using @content instead of @children.

I like @content but I'm worried that it might get used by the w3c someday.

@smt
Copy link

smt commented Sep 11, 2011

My favorite is @yield, but I would prefer @children over @content.

@doctyper
Copy link

Awesome!

In the context of @keyframes, I think it makes more sense to name the feature @content over @children (If I understand the syntax correctly):

@mixin keyframes {
    @-webkit-keyframes {
        @content;
    }

    @-moz-keyframes {
        @content;
    }
}

@include keyframes {
    0% {
        opacity: 1;
    }

    25% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.25;
    }

    75% {
        opacity: 0;
    }
}

@yield is interesting though...

@chriseppstein
Copy link
Author

Ah yes, this is a great use for @keyframes!

@nex3
Copy link
Contributor

nex3 commented Sep 12, 2011

I think we should go for @content, with the usual assumption that the w3c moves slowly enough that we can migrate the syntax to avoid a conflict should they add support for it.

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

Successfully merging this pull request may close these issues.

7 participants