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

New css interface #1129

Merged
merged 13 commits into from
Jun 14, 2019
Merged

New css interface #1129

merged 13 commits into from
Jun 14, 2019

Conversation

kof
Copy link
Member

@kof kof commented Jun 12, 2019

Implements #747, for now just objects syntax.

@kof kof requested a review from HenriBeck as a code owner June 12, 2019 21:23
@kof kof self-assigned this Jun 12, 2019
@kof kof requested review from HenriBeck and removed request for HenriBeck June 12, 2019 21:24
packages/css-jss/package.json Show resolved Hide resolved
packages/css-jss/src/createCss.js Outdated Show resolved Hide resolved
export type {Css, Style}

export const create = (sheet?: StyleSheet): Css => {
if (sheet) defaultSheet.detach()
Copy link
Member

Choose a reason for hiding this comment

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

Why would we detach in such a case? The user still could have used the default sheet

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, not sure what to do here, the problem I see is that if user creates custom jss/sheet, this sheet will already be in the DOM with no rules.

So maybe I need to additionally check if there are rules

Copy link
Member

Choose a reason for hiding this comment

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

Would this be a big benefit? I don’t think it will make a big difference in performance

Copy link
Member Author

Choose a reason for hiding this comment

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

Just the fact that there would be an empty style tag in the head, though evtl it doesn't matter for client side and won't happen on the server so fuck it, I am removing the line.

use createCss directly

Co-Authored-By: Henri <henribeck.dev@gmail.com>
@kof kof requested a review from HenriBeck June 14, 2019 12:07
@kof
Copy link
Member Author

kof commented Jun 14, 2019

merging it now to make it into the next alpha, if you find anything else, write it here or #747

@kof kof closed this Jun 14, 2019
@kof kof reopened this Jun 14, 2019
@kof kof merged commit 0af646d into master Jun 14, 2019
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