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

Is it time to drop Aphrodite? #60

Closed
jaredpalmer opened this issue Jun 6, 2016 · 8 comments
Closed

Is it time to drop Aphrodite? #60

jaredpalmer opened this issue Jun 6, 2016 · 8 comments

Comments

@jaredpalmer
Copy link
Owner

My problem is Aphrodite is a lack of composebility....base styles with overrides are impossible. I prefer jsxstyle for this, but it has not yet been updated for React 15.

Should we move to CSS Modules in the meantime? If so, What PostCSS plugins should we use?

@rowellx68
Copy link
Contributor

Could allow SASS-like writing of CSS --> https://github.com/jonathantneal/precss

@b2whats
Copy link

b2whats commented Jun 7, 2016

@jaredpalmer mm, yes

      { test: /\.css$/, loader: "style!css!postcss" },  //vendor css
      { test: /\.mcss$/, loader: "style!css?module&localIdentName=[name]__[local]___[hash:base64:5]!postcss" }, // css modules for complex logic

@b2whats
Copy link

b2whats commented Jun 7, 2016

and may be change aphrodite on css-look or jss??

@ranyefet
Copy link

ranyefet commented Jun 8, 2016

Does CSS modules support server side rendering?
Also what about selectors like nth-child and other stuff that currently not usable?
Will CSS modules improve on that?

@jaredpalmer
Copy link
Owner Author

@ranyefet yes, css modules does support ssr, we could use extract-text loader. Problem is that you usually have to include all of the css for the whole app, which can get heavy. There are ways to async load using react-side-effect though.

@b2whats
Copy link

b2whats commented Jun 13, 2016

@jaredpalmer
Problem is that you usually have to include all of the css for the whole app, which can get heavy.
This is not problem. We can wrap css from css files similary aphrodite and render on server only critical styles for first view.

@ranyefet
Copy link

Maybe we can use Isomorphic-Style-Loader which render CSS critical path, so it fixes the issues to loading the whole app CSS for every page.
What do you think?

@jaredpalmer
Copy link
Owner Author

Update on this:

I am had an idea / working on modification to jsxstyle that I'm hoping will be a game changer. If you aren't familiar with jsxstyle, you co-locate component styles as props like <Block backgroundColor="#000" />. My fork introduces special prop prefixes for the most common pseudo selectors. When it's done you'll be able to write <Block backgroundColor="#000" hoverBackgroundColor="#555" />. It will then extract non-conflicting classnames as it does now, but also add new pseudo selectors declarations to respective CSS classes.

When I'm finished, I will likely replace Aphrodite with this solution.

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

No branches or pull requests

4 participants