Skip to content

Commit 70f2ff6

Browse files
authored
Update README.md
1 parent 83b18d6 commit 70f2ff6

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

README.md

+34-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ Use whatever you'd like, but there's a few advantages with this approach over Ta
6262

6363
## 👁️ CSS Scope Inline vs Tailwind CSS Showdowns
6464
### Basics
65+
Tailwind verbosity goes up with more child elements.
6566
```html
66-
<!-- CSS Scoped Inline -->
67+
<!-- CSS Scope Inline -->
6768
<div>
6869
<style>
6970
.me { background: red; }
@@ -94,7 +95,6 @@ Use whatever you'd like, but there's a few advantages with this approach over Ta
9495
</div>
9596
```
9697
### CSS variables and child styling
97-
9898
```html
9999
<!doctype html>
100100
<head>
@@ -142,6 +142,38 @@ Use whatever you'd like, but there's a few advantages with this approach over Ta
142142
</body>
143143
</html>
144144
```
145+
### From the [Tailwind Manual](https://tailwindcss.com/docs/utility-first)
146+
Converted from the manual- Tailwind should be at its strongest here! 🙂
147+
```html
148+
<!-- CSS Scope Inline -->
149+
<div>
150+
<style>
151+
.me { display:flex; max-width:24rem; margin:0 auto; padding:1.5rem; background:#fff; border-radius:0.5rem; }
152+
.me div[n1] img { height:3rem; width:3rem; }
153+
.me div[n2] { margin:0 0 0 1.5rem; padding:0.25rem 0 0 0; }
154+
.me div[n2] h4 { color:#1a202c; font-size:1.25rem; }
155+
.me div[n2] p { color:#718096; font-size:1rem; }
156+
</style>
157+
<div n1>
158+
<img src="/img/logo.svg" alt="ChitChat Logo">
159+
</div>
160+
<div n2>
161+
<h4>ChitChat</h4>
162+
<p>You have a new message!</p>
163+
</div>
164+
</div>
165+
166+
<!-- Tailwind Example -->
167+
<div class="flex max-w-sm mx-auto p-6 bg-white rounded-xl items-center space-x-4">
168+
<div class="shrink-0">
169+
<img class="h-12 w-12" src="/img/logo.svg" alt="ChitChat Logo">
170+
</div>
171+
<div>
172+
<div class="text-xl font-medium text-black">ChitChat</div>
173+
<p class="text-slate-500">You have a new message!</p>
174+
</div>
175+
</div>
176+
```
145177

146178
## 🔎 Technical FAQ
147179
* Why do you use `QuerySelectorAll()` and not just process the `MutationObserver` results directly?

0 commit comments

Comments
 (0)