Skip to content

Preprocess future-proof CSS features #130

Closed
@giuseppeg

Description

@giuseppeg

Would you be open to add a few future-proof PostCSS plugins to transpile things like custom properties, calc, custom media queries?

This could be as simple as using the postcss-cssnext plugin or set up a lil preprocessor like we did for suitcss.

If there is interest I can probably help out.

Activity

mxstbr

mxstbr commented on Jul 23, 2016

@mxstbr
Contributor

There's an ongoing discussion about this in #78!

The TL;DR by @gaearon about cssnext is:

Whatever we add, it needs to be rock-stable. I’m worried about issue lists like this: https://github.com/postcss/postcss-import/issues.

giuseppeg

giuseppeg commented on Jul 23, 2016

@giuseppeg
Author

That one is a more broad topic since it is about adding support for SASS/Less.
What I was asking here is if there is any interest in transpiling future-proof features like we already do in JavaScript with Babel.

Regarding cssnext, yep I agree that "there’s a lot of stuff there" – if we want to play it safe we could just add imports, variables (custom properties), calc, custom-media and autoprefixer.

Anyway I am fine with waiting and see where #78 goes.

gaearon

gaearon commented on Jul 23, 2016

@gaearon
Contributor

We are open to add transpilation for standardized features if those tools don't have large issue lists. We don't want to recommend broken tools by default.

reopened this on Sep 8, 2016
added this to the 1.0.0 milestone on Sep 8, 2016
gaearon

gaearon commented on Sep 8, 2016

@gaearon
Contributor

Since #78 has gone a little bit too broad, let’s use this issue for specific proposals about PostCSS plugins that are safe to enable, work great, correspond to stable specs, and give at least some of the features people want.

giuseppeg

giuseppeg commented on Sep 9, 2016

@giuseppeg
Author

Stable

TBD

N.B. the plugins below don't support dynamic custom properties i.e. cp are compiled to static values.

  • postcss-custom-properties for simple constants (from this blog post it seems that Facebook uses them too)
    postcss-easy-import would be great but there are some buggy edge cases – fwiw I never had issues with it. Considering that webpack creates a bundle though probably it is not needed (we can run postcss on the bundle)

Personally I also use postcss-autoreset and Stylelint but those require custom configuration.

modified the milestones: 0.5.0, 1.0.0 on Sep 13, 2016

50 remaining items

tonyxiao

tonyxiao commented on Sep 24, 2016

@tonyxiao

@daviestar do you have one css file per component then? Or just a single massive _index.css file at project root?

daviestar

daviestar commented on Sep 24, 2016

@daviestar

@tonyxiao I put SASS files in with my components, but as I said above I don't really agree I should import them into JS as IMO, CSS doesn't work that way. I can easily avoid it by compiling all my SASS files to one CSS file at the root using gulp, then just import that so webpack picks it up in development.

tonyxiao

tonyxiao commented on Sep 24, 2016

@tonyxiao

Got it, thanks a pretty workable approach if you just completely avoid importing css into js. thanks for sharing @daviestar

gaearon

gaearon commented on Sep 30, 2016

@gaearon
Contributor

Let’s close as there is no consensus and I don’t feel comfortable proceeding with this.

jonathantneal

jonathantneal commented on May 21, 2017

@jonathantneal

That Sassy nesting has finally been fixed.

MoOx

MoOx commented on May 29, 2018

@MoOx
Contributor

FYI, I deprecated cssnext in favor of postcss-preset-env, you might want to think about this one that offers stages like babel-preset-env!

ai

ai commented on May 29, 2018

@ai
Contributor

Yeap. With postcss-preset-env we can enable only stable CSS specs. It has stage option same as in Babel.

gaearon

gaearon commented on Oct 2, 2018

@gaearon
Contributor

We run postcss-preset-env now.

jonathantneal

jonathantneal commented on Oct 2, 2018

@jonathantneal

I’d love to share this with my family and friends. I wrote PostCSS Preset Env, the tool you are using to future proof CSS. I hope it’s not presumptuous to ask, but might it earn a mention or thanks in the blog notes, @gaearon?

https://reactjs.org/blog/2018/10/01/create-react-app-v2.html

gaearon

gaearon commented on Oct 2, 2018

@gaearon
Contributor

We should probably include it into the notes. I forgot.

locked and limited conversation to collaborators on Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ai@MoOx@jonathantneal@jquense@tonyxiao

        Issue actions

          Preprocess future-proof CSS features · Issue #130 · facebook/create-react-app