Comments (8)
::before
/ ::after
also should definitely be supported.
from container-query.
I would love to try and take a look at it.
from container-query.
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:
- Allows the code to react to these condition changes somewhere in a smarter way, or
- 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.
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.
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.
Sure, no worries 👍
Have you tried the package in a project already, or just planning to?
from container-query.
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.
Got it, thanks 👍
I thought someone would sooner or later want this feature. 😅
from container-query.
Related Issues (20)
- Switch from findDOMNode() to refs HOT 7
- An in-range update of prettier is breaking the build 🚨 HOT 1
- Refactor to Typescript
- Implement useContainerQuery
- New container declaration syntax
- Do you support for Preact ? HOT 1
- Vue Example HOT 1
- Support for `x < width < y` queries
- The react component should optionally pass in the container size HOT 3
- Use a single Mutation Observer observation on body
- Handle a subset of cyclic issues with statically analyzing the CSS HOT 2
- Transpile the postcss plugin down to es5 properly HOT 1
- React component mounting / unmounting issue HOT 1
- Make the ContainerQuery component accept `children` HOT 1
- Remove the need for a root container class HOT 1
- postcss-container-query with require() HOT 1
- Add information for developers HOT 4
- Version 10 of node.js has been released
- Random classes picked up by json. HOT 9
- React 16 warnings HOT 3
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 container-query.