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

Implement support for ::before and ::after pseudo elements #140

Open
nicoburns opened this issue Sep 23, 2024 · 0 comments
Open

Implement support for ::before and ::after pseudo elements #140

nicoburns opened this issue Sep 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nicoburns
Copy link
Collaborator

::before and ::after are quite widely used. And current such content is just missing when rendered with Blitz. Use cases that I'm aware of are:

  • Icon fonts such as Font Awesome
  • Decorative markers on elements (these are often absolutely positioned)

Some notes:

  • ::before and ::after behave as elements inside the node they are targeting, as the first and last children.
  • In Blitz should probably be implemented as Option<NodeId> where the node is of type AnonymousBlock (which we might want to rename to PsuedoElement / we might also want to merge with Element).
  • They should probably be included in the layout_children of the parent node if possible.
  • I'm not quite sure when or how the anonymous nodes should be generated
  • We'll also need to clean them up when the parent is dropped (or it's styles change such that it no longer has a ::before or ::after style, but this problem also applies to anonymous blocks so this could be ignored for now (and dealt with along with the other memory leaks).
@nicoburns nicoburns added the enhancement New feature or request label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant