question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

before:content-['>'] doesn't work

See original GitHub issue

What version of Tailwind CSS are you using?

2.2.7

What build tool (or framework if it abstracts the build tool) are you using?

"next": "11.1.0" and web playground

What version of Node.js are you using?

v14.16.0

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction repository

https://play.tailwindcss.com/EMk3HoEN4O

Describe your issue

Hey Tailwind team!

I’m having an issue about content-utilities in JIT mode.

According to that document, we can write content value via content-* utilities, and it seems like all of them work well.

But I found a bug unexpectedly while I’m trying to use content-['>'].

The result of the rendering does not show the content >. You can reproduce by the Reproduction repository URL.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
adamwathancommented, Sep 20, 2021

Thanks for providing those workarounds @aggreggator and @nghiepit! I think we can properly support this by improving the regex we use to detect class names in your templates — right now we completely ignore “>” and “<” because they are markers for HTML tags (like <div>) but the HTML in the original post parses just fine in browsers, so we should be able to accommodate it.

Will leave this open so we have a chance to look, but the workarounds above (especially the character code option) have basically no downside in the mean time so that’s great 👍

1reaction
amirhosseinfarajicommented, Sep 18, 2021

@rowild with attribute:

@apply content-[attr(data-content)] mr-3 text-red-600;

with empty content

@apply content-[''] mr-3 text-red-600;
Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS :before and :after not working? [duplicate] - Stack Overflow
The easiest thing to do is, in the css, set content: '' for both pseudoelements.
Read more >
::before / ::after | CSS-Tricks - CSS-Tricks
The ::before and ::after pseudo-elements in CSS allows you to insert content onto a page without it needing to be in the HTML....
Read more >
[Fixed] CSS :after element is not working - Weekend Projects
A few ways to fix why :after element is not working. 1. We need to check if we are using the right HTML...
Read more >
before - CSS: Cascading Style Sheets - MDN Web Docs
In CSS, ::before creates a pseudo-element that is the first child of the selected element. It is often used to add cosmetic content...
Read more >
CSS Before and CSS After – How to Use the Content Property
The content property in CSS defines the content of an element. You may have heard that this property only applies to the ::before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found