-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add safelist keyframes and css variables
- Loading branch information
Showing
7 changed files
with
169 additions
and
4 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
22 changes: 22 additions & 0 deletions
22
packages/purgecss/__tests__/test_examples/safelist/safelist_css_variables.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
:root { | ||
--primary-color: blue; | ||
--secondary-color: indigo; | ||
--tertiary-color: aqua; | ||
--unused-color: violet; | ||
--used-color: rebeccapurple; | ||
--accent-color: orange; | ||
} | ||
|
||
.button { | ||
--button-color: var(--tertiary-color); | ||
--border-color: linear-gradient(to top, var(--secondary-color), var(--used-color, white)); | ||
|
||
background-color: var(--primary-color); | ||
color: var(--accent-color); | ||
border-color: var(--border-color); | ||
} | ||
|
||
.button:focus { | ||
background-color: var(--accent-color); | ||
color: var(--primary-color); | ||
} |
1 change: 1 addition & 0 deletions
1
packages/purgecss/__tests__/test_examples/safelist/safelist_css_variables.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<button class="button">Click me!</button> |
61 changes: 61 additions & 0 deletions
61
packages/purgecss/__tests__/test_examples/safelist/safelist_keyframes.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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
@keyframes bounce { | ||
from, 20%, 53%, 80%, to { | ||
animation-timing-function: cubic-bezier(0.3, 0.1, 0.9, 1.000); | ||
transform: translate3d(1, 1, 0); | ||
} | ||
} | ||
|
||
.bounce { | ||
-webkit-animation-name: bounce; | ||
animation-name: bounce; | ||
-webkit-transform-origin: center bottom; | ||
transform-origin: center bottom; | ||
} | ||
|
||
@keyframes flash { | ||
from, 50%, to { | ||
opacity: 1; | ||
} | ||
|
||
25%, 75% { | ||
opacity: 0.5; | ||
} | ||
} | ||
|
||
.flash { | ||
animation: flash | ||
} | ||
|
||
@keyframes scale { | ||
from { | ||
transform: scale(1); | ||
} | ||
|
||
to { | ||
transform: scale(2); | ||
} | ||
} | ||
|
||
@keyframes scale-down { | ||
from { | ||
transform: scale(2); | ||
} | ||
|
||
to { | ||
transform: scale(1); | ||
} | ||
} | ||
|
||
@keyframes spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
|
||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
.scale-spin { | ||
animation: spin 300ms linear infinite forwards,scale 300ms linear infinite alternate; | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/purgecss/__tests__/test_examples/safelist/safelist_keyframes.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<div class="bounce"> | ||
</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
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