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

Add mixins by new proposal #203

Closed
ai opened this issue Aug 25, 2015 · 13 comments
Closed

Add mixins by new proposal #203

ai opened this issue Aug 25, 2015 · 13 comments

Comments

@ai
Copy link

ai commented Aug 25, 2015

New proposal by @tabatkins with mixins by @apply rule http://tabatkins.github.io/specs/css-apply-rule/

@MoOx
Copy link
Owner

MoOx commented Sep 13, 2015

This one require postcss v5, will add that after #202

https://github.com/pascalduez/postcss-apply

@keithamus
Copy link

For any who land here, it looks as though #208 is the new issue that needs to be resolved before this lands.

@Jcan
Copy link

Jcan commented Jan 11, 2016

Hey MoOx - we are very excited about the function. do you have a timeline for it? Thanks ;-)

@Jcan
Copy link

Jcan commented Jan 14, 2016

I think Mixin is very useful. This is a simple example:

:root {
    --clearfix: {
        content: '';
        display: table;
        clear: both;
    }
}

#header {
    ......
    &::after {
        @apply --clearfix;
    }
}

Look forward for the new feature!

@MoOx
Copy link
Owner

MoOx commented Jan 17, 2016

If someone can double check that a plugin exists and follow the spec, this should be easy to add (PR welcome, and btw, here is the way to add a feature (maybe outdated a little, but should help, it's very easy to add a new plugin) https://github.com/MoOx/postcss-cssnext/blob/master/CONTRIBUTING.md#add-a-feature)

@zeke
Copy link

zeke commented Apr 8, 2016

Not sure I have the time or the chops to take this on, but would love to see it supported in cssnext!

@pascalduez
Copy link
Contributor

The aim of postcss-apply is to follow the "spec" as close as possible, but I feel it's a bit early to name it a "spec"?
Also it's suffering the same limitations as for custom properties, no cascading or inheritance so far.
I get to make it more clear on the readme.

Anyhow, I would be happy to see it used in CSSnext.

@MoOx
Copy link
Owner

MoOx commented Apr 11, 2016

As far as the limitation does not produce any change with or without the transformation, it's not an issue. postcss-custom-properties supported code will works in modern browsers without any different behavior.

I didn't read the spec at all so I can't say anything for now (and to be honest, I am not personally interested yet by this feature, and may never be - that don't mean it does not have its place to this project).

@pascalduez
Copy link
Contributor

Just wanted to show good willing after the last days "social highlight".
I guess it should live alongside postcss-custom-properties and follow the same guidelines, since they are pretty close.
But postcss-apply is just a handfull LOC after all, no big deal.

Open to move it to the PostCSS org if you feel it's needed.

Collaboration over fragmentation.

@MoOx
Copy link
Owner

MoOx commented Apr 21, 2016

@pascalduez feel free to make a PR with proper doc about limitation (like custom props).

@keithjgrant
Copy link

FYI: This has landed in Chrome 51 behind the experimental features flag.

https://www.chromestatus.com/feature/5753701012602880

@MoOx
Copy link
Owner

MoOx commented Jun 7, 2016

If anyone want to handle this, it should take a minute if the corresponding postcss plugin is ready.
See the doc to add a feature https://github.com/MoOx/postcss-cssnext/blob/master/CONTRIBUTING.md#add-a-feature

@pascalduez
Copy link
Contributor

@MoOx I'll give it a spin, sorry for the delay.
I tried using the plugins together, there might be a few tweaks needed up the pipeline.

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

7 participants