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

keep css class order #98

Closed
nha opened this issue Feb 6, 2016 · 4 comments
Closed

keep css class order #98

nha opened this issue Feb 6, 2016 · 4 comments

Comments

@nha
Copy link
Contributor

nha commented Feb 6, 2016

Considering that class order matters in css, I was expecting the following sablono fragment :

[:div.ui.middle.aligned.center.aligned.grid]

To render to the following :

class="ui middle aligned center aligned grid"

But instead I got :

class="aligned center grid middle ui"

Of course I can still use :className as a workaround, but it would be nice to keep the order.

@r0man
Copy link
Owner

r0man commented Feb 6, 2016

@nha Are you sure the order of the css classes on an attribute matters?
I found this, which says the order in the CSS file matters.
http://stackoverflow.com/questions/1321692/how-to-specifiy-the-order-of-css-classes

That said, I'm open to a change that keeps the order of classes. Right now sablono uses a set to store the class name. We could change this to a vector.

Patch welcome!

@nha
Copy link
Contributor Author

nha commented Feb 6, 2016

@roman Quite sure, it just happened to me.

Maybe if I find time, would you direct me towards the relevant lines ?

@r0man
Copy link
Owner

r0man commented Feb 6, 2016

@nha I think most of the set stuff is in the normalize namespace. See:
https://github.com/r0man/sablono/blob/master/src/sablono/normalize.cljc#L68

@r0man
Copy link
Owner

r0man commented Feb 9, 2016

Fixed in master

@r0man r0man closed this as completed Feb 9, 2016
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