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

Build component with PostCSS #19

Closed
wants to merge 4 commits into from
Closed

Build component with PostCSS #19

wants to merge 4 commits into from

Conversation

simonsmith
Copy link
Member

So this is a stab at building a component with PostCSS in response to - suitcss/preprocessor#11. It emits warnings to the console if the conformance fails, but we can also configure this to throw an error if needs be.

screen shot 2015-10-02 at 23 52 52

Hopefully the postcss-config.js could be dropped into each component and just work.
Each component can use just the plugins it requires.

cc @timkelty @giuseppeg

"autoprefixer": "^6.0.3",
"postcss": "^5.0.8",
"postcss-bem-linter": "^1.1.0",
"postcss-calc": "^5.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Button is not using postcss-calc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, we should really only use the plugins that each package uses.

@@ -1,4 +1,4 @@
/** @define Button; use strict */
/** @define Button */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does postcss-bem-linter always run in "strict mode"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you have to opt out of it with 'weak'

@giuseppeg
Copy link
Member

I like this approach!
I wonder if it can affect the overall build time of an application with hundreds of components though. Maybe we should benchmark this.

@simonsmith
Copy link
Member Author

I've built tens rather than hundreds before and it always seems to be fast. PostCSS claims to be one of the faster processors.

One thing I like here is that each package will compile with just the plugins it needs but makes it very easy for people to add more plugins should they need them.

@necolas
Copy link
Contributor

necolas commented Oct 3, 2015

I think moving all the packages into a monorepo should be considered while doing this. Individual components can still be published to their separate npm packages. But having to maintain the toolchain across lots of repos is going to be a hassle for you.

@simonsmith
Copy link
Member Author

I agree, it would make this easier if we were happy to give up building of individual components.

@simonsmith
Copy link
Member Author

Closing this in favour of the mono-repo approach in progress at suitcss/suit/issues/109

@simonsmith simonsmith closed this Oct 8, 2015
@simonsmith simonsmith deleted the postcss-build branch January 14, 2017 21:00
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.

3 participants