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

@ getting a little redundant with nesting #8

Open
patbrown opened this issue Aug 30, 2012 · 2 comments
Open

@ getting a little redundant with nesting #8

patbrown opened this issue Aug 30, 2012 · 2 comments

Comments

@patbrown
Copy link

Not a terminal issue, but a touch on the annoying side. I've been porting a few libraries to cssgen, because I prefer to write clojure code over Ruby. I'm running into a redundancy issue with parsing @

For instance
["@Keyframes flash"
["0%, 50%, 100%" :opacity :1]
["25%, 75%" :opacity :0]]

Becomes
@Keyframes flash {

} @Keyframes flash 0%, @Keyframes flash 50%, @Keyframes flash 100% {
opacity: 1;
}
@Keyframes flash 25%, @Keyframes flash 75% {
opacity: 0;
}

I understand the way nesting is designed in CSSGen and for most instances it is perfect, but in the event of designing responsive sites or utilizing CSS3 features it creates a lot of unnecessary bloat.

If I can figure out an elegant solution, I'll send you a pull. Right now my work-around is too jank.

@paraseba
Copy link
Owner

paraseba commented Sep 2, 2012

Thanks for reporting this, it's very interesting.
Do you have any idea for a better syntax that covers this case?
Please, if you make any changes, start with the 0.3.0 branch.

I'll try to look into this during the next days.

Thanks again

@patbrown
Copy link
Author

patbrown commented Sep 6, 2012

I'm working on the 0.3.0. I'm pleased with my setup. Currently, I have defined my own functions "css-container" and "css-container-close" They basically print the selector in a string and spit with an open bracket, close closes.

I've got a convenience function for declaring spit on a comment line at the top of the page labeling the subject of the file. I then use append on every consequential spit by default. The spits in the page all default to a folder "raw" in the cwd and the file-name is the namespace of the clj file creating them. I then reference the namespaces with another spit to concat my files into one. Not a slick as I'd like, but getting there, minification is possible with some simple regex, but I haven't felt the need yet.

I've also come up with a way to make animations, color-schemes, and a few other css3 goodies extremely functional from within css-gen. It needs to be slimmed down big time, it'll be a week or so, before I feel comfortable releasing. Let me know what you think about incorporating an animation, color tools, etc set of libraries. Otherwise, they work fine as plugins.

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

No branches or pull requests

2 participants