Giter Club home page Giter Club logo

Comments (8)

ZeeCoder avatar ZeeCoder commented on June 3, 2024

::before / ::after also should definitely be supported.

from container-query.

ahmadalfy avatar ahmadalfy commented on June 3, 2024

I would love to try and take a look at it.

from container-query.

ZeeCoder avatar ZeeCoder commented on June 3, 2024

Sounds good 👍

It might be a bit tricky, as what the plugin does is that instead of adding CSS to the DOM based on certain element conditions, it instead keeps track of all elements, and applies styles directly to them.

This means that to have support for pseudo-selectors, it would need to add / remove event listeners as conditions change.

If you want to give it a go, I can have a think of what the best solution would be, as it probably requires a refactor that either:

  1. Allows the code to react to these condition changes somewhere in a smarter way, or
  2. Replaces the current CSS-applying engine with one that injects actual CSS into the DOM, in which case implementing pseudo-selectors would be a no-brainer. 🤔

I have a gut-feeling the second option is probably the best one.

from container-query.

ZeeCoder avatar ZeeCoder commented on June 3, 2024

Actually, using something like styletron to handle css applying based on style objects would be the easiest, since then we wouldn't need to come up with a way to apply styles for only certain elements ourselves.

from container-query.

ahmadalfy avatar ahmadalfy commented on June 3, 2024

Thanks for the insights, I am currently examining the code and checking what can be done. Will keep your words in mind and update you with the results.

from container-query.

ZeeCoder avatar ZeeCoder commented on June 3, 2024

Sure, no worries 👍
Have you tried the package in a project already, or just planning to?

from container-query.

ahmadalfy avatar ahmadalfy commented on June 3, 2024

I am currently using the package in a project and it fits perfectly really. I've a valid use case for container query (or element query whatever people prefer to call it) and I was hit by the lack of support for the pseudo-classes 😆 and this is why I am seeing how to contribute 😄

from container-query.

ZeeCoder avatar ZeeCoder commented on June 3, 2024

Got it, thanks 👍

I thought someone would sooner or later want this feature. 😅

from container-query.

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.