@@ -62,8 +62,9 @@ Use whatever you'd like, but there's a few advantages with this approach over Ta
62
62
63
63
## 👁️ CSS Scope Inline vs Tailwind CSS Showdowns
64
64
### Basics
65
+ Tailwind verbosity goes up with more child elements.
65
66
``` html
66
- <!-- CSS Scoped Inline -->
67
+ <!-- CSS Scope Inline -->
67
68
<div >
68
69
<style >
69
70
.me { background : red ; }
@@ -94,7 +95,6 @@ Use whatever you'd like, but there's a few advantages with this approach over Ta
94
95
</div >
95
96
```
96
97
### CSS variables and child styling
97
-
98
98
``` html
99
99
<!doctype html>
100
100
<head >
@@ -142,6 +142,38 @@ Use whatever you'd like, but there's a few advantages with this approach over Ta
142
142
</body >
143
143
</html >
144
144
```
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
+ ```
145
177
146
178
## 🔎 Technical FAQ
147
179
* Why do you use ` QuerySelectorAll() ` and not just process the ` MutationObserver ` results directly?
0 commit comments