Skip to content

Commit 9bb788c

Browse files
authored
Update README.md
1 parent 7f1a1a7 commit 9bb788c

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ Or, 🌐 the CDN: `<script src="https://cdn.jsdelivr.net/gh/gnat/css-scope-inlin
4747

4848
Use whatever you'd like, but there's a few advantages with this approach over Tailwind, Twind, UnoCSS:
4949

50-
* No more [repeating styles](https://tailwindcss.com/docs/reusing-styles) on child elements (..and no [@apply](https://tailwindcss.com/docs/reusing-styles#extracting-classes-with-apply), no `[&>*]`). It's just CSS!
51-
* No more visual noise on every `<div>`. Use a local `<style>` per group.
50+
* No more [repeating styles](https://tailwindcss.com/docs/reusing-styles) on child elements (..no [@apply](https://tailwindcss.com/docs/reusing-styles#extracting-classes-with-apply), no `[&>thing]` per style). It's just CSS!
51+
* No endless visual noise on every `<div>`. Use a local `<style>` per group.
5252
* No high risk of eventually requiring a build step.
5353
* No chance of [deprecations](https://windicss.org/posts/sunsetting.html). 18 lines is infinitely maintainable.
5454
* Get the ultra-fast "inspect, play with styles, paste" workflow back.
@@ -120,32 +120,34 @@ Tailwind verbosity goes up with more child elements.
120120
<div>
121121
<style>
122122
.me { margin:8px 6px; }
123-
.me a { display:block; padding:8px 12px; margin:10px 0; background:var(--color-1); border-radius:10px; text-align:center; }
124-
.me a:hover { background:var(--color-1-active); color:white; }
123+
.me div a { display:block; padding:8px 12px; margin:10px 0; background:var(--color-1); border-radius:10px; text-align:center; }
124+
.me div a:hover { background:var(--color-1-active); color:white; }
125125
</style>
126-
<a href="#">Home</a>
127-
<a href="#">Team</a>
128-
<a href="#">Profile</a>
129-
<a href="#">Settings</a>
130-
<a href="#">Log Out</a>
126+
<div><a href="#">Home</a></div>
127+
<div><a href="#">Team</a></div>
128+
<div><a href="#">Profile</a></div>
129+
<div><a href="#">Settings</a></div>
130+
<div><a href="#">Log Out</a></div>
131131
</div>
132132

133133
<!-- Tailwind Example 1 -->
134134
<div class="mx-2 my-4">
135-
<a href="#" class="block py-2 px-3 my-2 bg-[color:var(--color-1)] rounded-lg text-center hover:bg-[color:var(--color-1-active)] hover:text-white">Home</a>
136-
<a href="#" class="block py-2 px-3 my-2 bg-[color:var(--color-1)] rounded-lg text-center hover:bg-[color:var(--color-1-active)] hover:text-white">Team</a>
137-
<a href="#" class="block py-2 px-3 my-2 bg-[color:var(--color-1)] rounded-lg text-center hover:bg-[color:var(--color-1-active)] hover:text-white">Profile</a>
138-
<a href="#" class="block py-2 px-3 my-2 bg-[color:var(--color-1)] rounded-lg text-center hover:bg-[color:var(--color-1-active)] hover:text-white">Settings</a>
139-
<a href="#" class="block py-2 px-3 my-2 bg-[color:var(--color-1)] rounded-lg text-center hover:bg-[color:var(--color-1-active)] hover:text-white">Log Out</a>
135+
<div><a href="#" class="block py-2 px-3 my-2 bg-[--color-1] rounded-lg text-center hover:bg-[--color-1-active] hover:text-white">Home</a></div>
136+
<div><a href="#" class="block py-2 px-3 my-2 bg-[--color-1] rounded-lg text-center hover:bg-[--color-1-active] hover:text-white">Team</a></div>
137+
<div><a href="#" class="block py-2 px-3 my-2 bg-[--color-1] rounded-lg text-center hover:bg-[--color-1-active] hover:text-white">Profile</a></div>
138+
<div><a href="#" class="block py-2 px-3 my-2 bg-[--color-1] rounded-lg text-center hover:bg-[--color-1-active] hover:text-white">Settings</a></div>
139+
<div><a href="#" class="block py-2 px-3 my-2 bg-[--color-1] rounded-lg text-center hover:bg-[--color-1-active] hover:text-white">Log Out</a></div>
140140
</div>
141141

142142
<!-- Tailwind Example 2 -->
143-
<div class="mx-2 my-4 [&>a]:block [&>a]:py-2 [&>a]:px-3 [&>a]:my-2 [&>a]:bg-[color:var(--color-1)] [&>a]:rounded-lg [&>a]:text-center [&>a:hover]:bg-[color:var(--color-1-active)] [&>a:hover]:text-white">
144-
<a href="#">Home</a>
145-
<a href="#">Team</a>
146-
<a href="#">Profile</a>
147-
<a href="#">Settings</a>
148-
<a href="#">Log Out</a>
143+
<div class="mx-2 my-4
144+
[&_div_a]:block [&_div_a]:py-2 [&_div_a]:px-3 [&_div_a]:my-2 [&_div_a]:bg-[--color-1] [&_div_a]:rounded-lg [&_div_a]:text-center
145+
[&_div_a:hover]:bg-[--color-1-active] [&_div_a:hover]:text-white">
146+
<div><a href="#">Home</a></div>
147+
<div><a href="#">Team</a></div>
148+
<div><a href="#">Profile</a></div>
149+
<div><a href="#">Settings</a></div>
150+
<div><a href="#">Log Out</a></div>
149151
</div>
150152
</body>
151153
</html>

0 commit comments

Comments
 (0)