Comments (8)
Thanks a lot 😊
The double classes are there to increase specificity such that common scenarios of overriding styles set using $nest works seamlessly. As far as i can tell your example is working as expected, you're just wondering about the generated css - correct?
from bss.
Yes, it's correct. In example was not any problems.
I had changed example to show my problem. Last one button should be with green background.
from bss.
May be this one can be fixed by adding $add, that would be $nest without a space in className definition
from bss.
I don't think bss
lends itself well to mixins and this type of composition.
Notice how you can achieve the same thing, but in a much more simple way by doing like this
I do have some thoughts on how to improve bss and component composition, but I don't think those solves this kind of issue.
from bss.
This is a simplified example.
Through this type of composition i trying to apply some additional behavior to components (like ability to select, drag'n'drop, additional onclick handlers). And some kind of mixins required a visual changes.
May be i need to change this approach to changing only attrs
of mixed component. And these components will be care about styling itself.
from bss.
@LastDreamer ah, I see, and you want to avoid wrapping the component in an extra element to put the behavior there?
You could use .$nest(':nth-child(n)', ...)
to increase specificity.
I'm still curious if there is a better approach to solving your setup using a different kind of composition, but it's beside the issue and bss here, so if you want to explore / discuss that we could probably reach something interesting in the mithril gitter channel ;)
from bss.
I think i found better solution without any problems.
Thank you for help!
from bss.
Ah yes, that seems good. I wanted to make composing bss instances easier too, so at some point you could pass them around instead..
from bss.
Related Issues (20)
- POJO style question HOT 7
- using bss-react module just for react HOT 10
- Make shorthands a little magic HOT 13
- Allow multiline property value declarations HOT 2
- v2: Extract shorthands into helpers object
- v2: letter-spacing auto px
- Unit interpolation fails in node HOT 1
- convert fractions to percentage values HOT 6
- assign deeper HOT 3
- document how helpers can be used in lean strings HOT 1
- Simple integration width vuejs. HOT 1
- Line Height when given a unitless value doesn't return as expected HOT 3
- SVGs defined in background data urls don't work HOT 1
- Helpers defined with hyphen-case never get called HOT 1
- `$nest` and `$media` not applying style. HOT 3
- Feature Request: Built-in CSS Class Composition HOT 7
- Partial application overload for binary signature methods HOT 9
- Duplicate selector doesn't concat style. HOT 2
- Debug mode makes bugs harder to find HOT 1
- Some functions don't work on Mozilla Firefox lastest update (97.0) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bss.