-
Notifications
You must be signed in to change notification settings - Fork 47
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
[roadmap] sheetify v6 #105
Comments
hey @yoshuawuyts, sounds good to me. 👍 from my usage of |
@ahdinosaur yeah a simpler way would be to declare css variables in a |
e.g. const css = require('sheetify')
css`
:root {
--main-bg-color: brown;
}
`
/* can be in another file */
css`
.foo {
background-color: var(--main-bg-color);
}
` |
@yoshuawuyts The above example looks good to me 👍 |
@yoshuawuyts you're right that's way simpler, thanks for the suggestion. ✨ |
Patches are done; can release
yay! |
when using it like you suggest above, doesn't that encourage the use of a lot of global variables? What if i have many components that were authored by different people, which used the same name for their variables, maybe even set those variables... how can i make sure my global css variable won't override or be overridden by a component that uses and sets it too? |
what about const css = require('sheetify')
var x = css`
:root {
--main-bg-color: brown; /* will be auto-suffixed */
}
`
/* can be in another file */
css`
.foo {
background-color: var(${x[':root/--main-bg-color']});
}
` then maybe somewhere in a root component that uses a lot of other components, maybe sheetify can offer the sum of all variables that have been defined in all the levels of nested components, so i can generate a style tag that sets all the values for all the variables... like maybe var css = require('sheetify')
var yo = require('yo-yo')
Object.keys(css.vars()).forEach(x=>console.log(x)) // to see what is available for theming
// then later - remove the line above and replace it with something like:
css.vars()[':root/--main-bg-color'] = 'pink' |
That wouldn't work as sheetify always returns a prefix. Having multiple On Wed, Nov 16, 2016, 17:35 Alexander Praetorius [email protected]
|
Released as |
oh, didnt know sheetify is prefixing - guess that's fine too. I try to build components which are white labeled pages made up of footer components and header components, made up of smaller components. If those components are written by different people or maybe by different me over time... i might not always remember what kind of css variables or names i used in all those different components, like: button, searchbar, signup form, image slider, menubar, and so on... But once i pull all of them in to build a landing page component, how do i theme it? I think that's were the basic idea from above comes from. Of course, how to express that in syntax is secondary to me. I would appreciate some thoughts on how to deal with "complex" components made up of many sub components that i would like to theme and customize. I think i might not remember all the details, but something like |
yeah so you might be looking for something closer to styled-elements which On Sat, Nov 19, 2016 at 5:11 AM Alexander Praetorius <
|
Been using sheetify for a while now, and feel there's some rough edges still. In this issue I try and outline which problems I've been experiencing, and suggest solutions on how to fix 'em. Comments and suggestions super welcome; if we need to break stuff this is the place to mention it
problems
insert-css
as a peer dep is hella annoying and probably makes for a not-so-great user experience - usingsheetify
right now doesn't "just work" and yeah it would be cool if it didtodos
insert-css
a file in sheetify that can be required in, removing the peer dep (prcss-extract
to also detect thesheetify/insert
(minor patch; just pick up more files):host
properties are prefixedAnd that's it. Suggestions and thoughts super welcome!
The text was updated successfully, but these errors were encountered: