Closed CupOfTea696 closed 5 years ago
wow thanks for all your work @CupOfTea696! I'll review over the weekend.
No worries, I use this a lot both at my job and for personal projects so :)
@CupOfTea696 same here :)
One thing I've been thinking about lately: having a postcss version and sass version (and there's a PR for a stylus version too) makes the project really hard to contribute to. I have both sass and postcss projects though, so I'm wondering if maybe there's a way to have a single postcss version that would work in both. What do you think?
one way we could accomplish that would be to make csstyle a webpack loader rather than a postcss/scss plugin...
Well having different versions does allow users to integrate it more easily in their existing workflow, whatever that workflow may be. Some people use GUI apps to compile their sass etc...
@geddski Doesn't postcss have a sass compiler though?
Added new feature: Policies. Explanation in OP.
@CupOfTea696 I'm thinking it may be time for me to hand csstyle over to a new owner. You interested? From what I can tell, you'd take care of it and move it in a great direction. Let me know.
Yeah, I'd be up for taking over the project :)
cool DM me on twitter @geddski and we'll get the transfer going.
--csstyle 2
So over the last couple of days I've been working on a 2.0 version of csstyle. This isn't finished yet, just showing of the changes I've made and a starting point for a discussion around the 2.0 release.
Tasks
Changes
/
by default. Considering changing this to.
so it has more of a javascript chaining style.app
. Considering changing the variable name tocsstyle-app-id
.&:hover &
trick.component
,option
,part
,tweak
andlocation
helper functions, to create the respective class / partial class from a name..travis.yml
for Travis CI runner.New feature
Policies
CSStyle introduces Policies, which is essentially a convenient way to apply "rules" to classes. This is very useful to share a set rules between different components etc. A policy is essentially a placeholder class that has no use on its own.
Example:
Renders to:
Notes: I un-deprecated locations, but this is up for discussion. I would love to see them back however. I mostly used them on the body tag to modify styles based on page / certain "states" (like
@home,
@mobileand
@has-admin-bar`). This should be the recommended use for locations.Locations now don't use an ID anymore (see #30). They now only override components, parts and tweaks. They behave in virtually the same way, except that locations will always be the parent selector, even if they are nested inside components.