Skip to content

Nested component CSS doesn't work well with tailwind #18175

Answered by wongjn
ozooxo asked this question in Help
Discussion options

You must be logged in to vote

However, I see both <div> blocks turn blue

This is because the CSS rules in markdown.css select all <ul> and <li> elements. Instead, consider creating a utility in globals.css that scopes these styles:

Suggested changes
diff --git a/app/globals.css b/app/globals.css
index a2dc41e..7699705 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -24,3 +24,13 @@ body {
   color: var(--foreground);
   font-family: Arial, Helvetica, sans-serif;
 }
+
+@utility markdown {
+  ul {
+    list-style: disc;
+  }
+
+  li {
+    color: blue;
+  }
+}
diff --git a/app/markdown.css b/app/markdown.css
deleted file mode 100644
index 82852bc..0000000
--- a/app/markdown.css
+++ /dev/null
@@ -1,7 +0,0 @@
-ul {
-

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ozooxo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #18169 on May 29, 2025 07:26.