Code Monkey home page Code Monkey logo

Comments (8)

porsager avatar porsager commented on June 3, 2024

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.

LastDreamer avatar LastDreamer commented on June 3, 2024

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.

LastDreamer avatar LastDreamer commented on June 3, 2024

May be this one can be fixed by adding $add, that would be $nest without a space in className definition

from bss.

porsager avatar porsager commented on June 3, 2024

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.

LastDreamer avatar LastDreamer commented on June 3, 2024

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.

porsager avatar porsager commented on June 3, 2024

@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.

LastDreamer avatar LastDreamer commented on June 3, 2024

I think i found better solution without any problems.

Thank you for help!

from bss.

porsager avatar porsager commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.