-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix: Converted inline item width to CSS variable (fixes #158) #159
Conversation
I guess my issue with the CSS variable approach is that it makes the following difficult:
|
Could you explain how you propose to fix this part of my previous comment:
Such that all of the correct width values are present with predefined classes: .has-2-columns .hotgrid__item {
width: 50%;
}
.has-3-columns .hotgrid__item {
width: 33%;
}
.has-4-columns .hotgrid__item {
width: 25%;
}
.has-5-columns .hotgrid__item {
width: 20%;
} Would you use a mixin and add all of the possible classes to the less output (2-10 columns?), would you have to manually add more classes if you needed more columns? Note: We added configuration classes like this a lot on previous components and menus (narrative, cover, blinds, etc) and it's very brittle and limited and irritating to write and understand and change and always adds excess less that isn't used to every project. Width values should be calculated at runtime rather than being predefined, it's easier and simpler. When adding the class You could add the It sounds as though you'd like to change all |
@oliverfoster This doesn't concern me that much as we can always specify "up to" a reasonable amount of options and use a mixin to create the classes. Unused styles are also unavoidable in many cases, so it doesn't bother me to have unused column classes hanging around (like the Vanilla theme's column classes).
I think this is an issue of separating styling from presentation/code. Style values should all live in the theme if possible.
Yes, classes are much easier to override and changes would most likely be at a global level. Also, I haven't looked at your recent commit(s). But as long as we have something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great thanks 👍 minor comment added regarding trailing space
🎉 This PR is included in version 4.6.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Fixes: #158
Fix