Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier replacing shimmers with content #22

Open
waldekmastykarz opened this issue Jun 17, 2021 · 1 comment
Open

Easier replacing shimmers with content #22

waldekmastykarz opened this issue Jun 17, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request htwoo-core Issue with htwoo-core

Comments

@waldekmastykarz
Copy link

Is your feature request related to a problem? Please describe.
When using shimmers, at some point you'd want to replace them with the actual content. Right now, that requires DOM manipulation to replace the shimmer elements with the actual content.

Describe the solution you'd like
What if it shimmers were done using the :empty CSS pseudo selector, so that shimmer is displayed when there is no content (eg. <div></div>). When the content is retrieved and set, the shimmer would be replaced with the content. Such approach would remove the need to manipulate the DOM.

Describe alternatives you've considered
n/a

@StfBauer StfBauer added the enhancement New feature or request label Jun 17, 2021
@juliemturner juliemturner added the htwoo-core Issue with htwoo-core label Mar 15, 2022
@gabbsmo
Copy link

gabbsmo commented Feb 23, 2024

Sounds good to me. Did some quick testing in DevTools and just changing the selectors to be .class:empty instead seems to just work.

With that said, you cannot get away from DOM manipulation if you want your loading indicator to accessible, as you would need to maintain the aria-busy attribute. See MDN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request htwoo-core Issue with htwoo-core
Projects
None yet
Development

No branches or pull requests

4 participants