patternfly-elements icon indicating copy to clipboard operation
patternfly-elements copied to clipboard

[feat] Set up an element query approach in the PFElement base class

Open mwcz opened this issue 5 years ago • 5 comments

eq.js adds element queries so that elements can respond to their own size, rather than the page's size.

https://github.com/Snugug/eq.js/

Evaluate eq.js performance, features, etc for inclusion within RHElements.

At first glance, it looks small enough (1.1kb min+gzip) and useful enough that I think making it available to all RHElements is a good idea.

mwcz avatar Nov 07 '18 19:11 mwcz

yay! Such a small and powerful library.

starryeyez024 avatar Nov 08 '18 01:11 starryeyez024

@mwcz seems like you're on board with adding this to the repo. With your permission I will include it in the hide-show component I'm working on now.

chrisdo1 avatar Dec 03 '18 15:12 chrisdo1

@chrisdo1 That's fine for a proof of concept, but if we do include eq.js it needs to be in the RHElement base class, with an API for components to opt-in to using it.

mwcz avatar Dec 03 '18 15:12 mwcz

I renamed this to be a bit more open-ended because it would be more lightweight to set up an EQ built into the base class rather than use a library. We can evaluate the EQ.js syntax for if we want to do something similar though.

castastrophe avatar Feb 05 '21 15:02 castastrophe

Do we still want this given ResizeObserver and container queries?

bennypowers avatar Feb 23 '22 22:02 bennypowers