-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Use classes for style encapsulation, rather than attributes
- Loading branch information
Showing
95 changed files
with
172 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// https://github.com/darkskyapp/string-hash/blob/master/index.js | ||
export default function hash(str: string): number { | ||
export default function hash(str: string): string { | ||
let hash = 5381; | ||
let i = str.length; | ||
|
||
while (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i); | ||
return hash >>> 0; | ||
return (hash >>> 0).toString(36); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[foo][svelte-xyz]{color:red}[baz][svelte-xyz]{color:blue} | ||
[foo].svelte-xyz{color:red}[baz].svelte-xyz{color:blue} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[foo=bar][svelte-xyz]{color:red} | ||
[foo=bar].svelte-xyz{color:red} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
div[svelte-xyz],[svelte-xyz] div{color:red} | ||
div.svelte-xyz,.svelte-xyz div{color:red} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.foo[svelte-xyz]{} | ||
.foo.svelte-xyz{} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@keyframes svelte-xyz-why{from{color:red}to{color:blue}}.animated[svelte-xyz]{animation:svelte-xyz-why 2s} | ||
@keyframes svelte-xyz-why{from{color:red}to{color:blue}}.animated.svelte-xyz{animation:svelte-xyz-why 2s} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[svelte-xyz]{color:red} | ||
.svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/cascade-false-universal-selector/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<div svelte-xyz=""></div> | ||
<div class="svelte-xyz"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
div[svelte-xyz]{color:red}div.foo[svelte-xyz]{color:blue}.foo[svelte-xyz]{font-weight:bold} | ||
div.svelte-xyz{color:red}div.foo.svelte-xyz{color:blue}.foo.svelte-xyz{font-weight:bold} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.test[svelte-xyz]>div[svelte-xyz]{color:#0af} | ||
.test.svelte-xyz>div.svelte-xyz{color:#0af} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<div svelte-xyz="" class="test"><div svelte-xyz="">Testing...</div></div> | ||
<div class="test svelte-xyz"><div class="svelte-xyz">Testing...</div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
div[svelte-xyz],[svelte-xyz] div{--test:10} | ||
div.svelte-xyz,.svelte-xyz div{--test:10} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/descendant-selector-non-top-level-outer/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
p[svelte-xyz] span[svelte-xyz]{color:red} | ||
p.svelte-xyz span.svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/descendant-selector-non-top-level-outer/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<div><p svelte-xyz=''><span svelte-xyz=''>styled</span></p></div> | ||
<div><p class="svelte-xyz"><span class="svelte-xyz">styled</span></p></div> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@media only screen and (min-width: 400px){div[svelte-xyz],[svelte-xyz] div{color:red}} | ||
@media only screen and (min-width: 400px){div.svelte-xyz,.svelte-xyz div{color:red}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@media(min-width: 400px){[svelte-xyz].large-screen,[svelte-xyz] .large-screen{display:block}} | ||
@media(min-width: 400px){.svelte-xyz.large-screen,.svelte-xyz .large-screen{display:block}} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-contains/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[data-foo*='bar'][svelte-xyz]{color:red} | ||
[data-foo*='bar'].svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-contains/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><p svelte-xyz="" data-foo="foobarbaz">this is styled</p> | ||
<div><p class="svelte-xyz" data-foo="foobarbaz">this is styled</p> | ||
<p data-foo="fooBARbaz">this is unstyled</p></div> |
2 changes: 1 addition & 1 deletion
2
...ss/samples/omit-scoping-attribute-attribute-selector-equals-case-insensitive/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[data-foo='bar' i][svelte-xyz]{color:red} | ||
[data-foo='bar' i].svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
...s/samples/omit-scoping-attribute-attribute-selector-equals-case-insensitive/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><p svelte-xyz="" data-foo="BAR">this is styled</p> | ||
<div><p class="svelte-xyz" data-foo="BAR">this is styled</p> | ||
<p data-foo="BAZ">this is unstyled</p></div> |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[data-foo='bar'][svelte-xyz]{color:red} | ||
[data-foo='bar'].svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><p svelte-xyz="" data-foo="whatever">this is styled</p> | ||
<div><p class="svelte-xyz" data-foo="whatever">this is styled</p> | ||
<p data-foo="baz">this is unstyled</p></div> |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-equals/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[data-foo='bar'][svelte-xyz]{color:red} | ||
[data-foo='bar'].svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-equals/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><p svelte-xyz="" data-foo="bar">this is styled</p> | ||
<div><p class="svelte-xyz" data-foo="bar">this is styled</p> | ||
<p data-foo="baz">this is unstyled</p></div> |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-pipe-equals/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[data-foo|='bar'][svelte-xyz]{color:red} | ||
[data-foo|='bar'].svelte-xyz{color:red} |
4 changes: 2 additions & 2 deletions
4
test/css/samples/omit-scoping-attribute-attribute-selector-pipe-equals/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<div><p svelte-xyz="" data-foo="bar">this is styled</p> | ||
<p svelte-xyz="" data-foo="bar-baz">this is styled</p> | ||
<div><p class="svelte-xyz" data-foo="bar">this is styled</p> | ||
<p class="svelte-xyz" data-foo="bar-baz">this is styled</p> | ||
<p data-foo="baz-bar">this is unstyled</p></div> |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-prefix/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[data-foo^='bar'][svelte-xyz]{color:red} | ||
[data-foo^='bar'].svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-prefix/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><p svelte-xyz="" data-foo="barbaz">this is styled</p> | ||
<div><p class="svelte-xyz" data-foo="barbaz">this is styled</p> | ||
<p data-foo="bazbar">this is unstyled</p></div> |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-suffix/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[data-foo$='bar'][svelte-xyz]{color:red} | ||
[data-foo$='bar'].svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-suffix/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><p data-foo="barbaz">this is unstyled</p> | ||
<p svelte-xyz="" data-foo="bazbar">this is styled</p></div> | ||
<p class="svelte-xyz" data-foo="bazbar">this is styled</p></div> |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-word-equals/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[data-foo~='bar'][svelte-xyz]{color:red} | ||
[data-foo~='bar'].svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector-word-equals/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><p svelte-xyz="" data-foo="qux bar">this is styled</p> | ||
<div><p class="svelte-xyz" data-foo="qux bar">this is styled</p> | ||
<p data-foo="qux baz">this is unstyled</p></div> |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[autoplay][svelte-xyz]{color:red} | ||
[autoplay].svelte-xyz{color:red} |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-attribute-selector/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><video svelte-xyz autoplay></video> | ||
<div><video class="svelte-xyz" autoplay></video> | ||
<video></video></div> |
2 changes: 1 addition & 1 deletion
2
test/css/samples/omit-scoping-attribute-class-dynamic/expected.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.foo[svelte-xyz]{color:red} | ||
.foo.svelte-xyz{color:red} |
Oops, something went wrong.