Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
2.5 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | # PostCSS Discard Overridden
|
---|
| 2 |
|
---|
| 3 | [PostCSS] plugin to discard overridden `@keyframes` or `@counter-style`.
|
---|
| 4 |
|
---|
| 5 | `@keyframes` or `@counter-style` will be overridden by those who share the same identifiers and appear later in stylesheets. So we can discard all of them except the last one. When defined inside a `@media` or `@supports` rule, `@keyframes` and `@counter-style` rules only override global rules in some of the client browsers so they need handled separately. This plugin has taken care of this and transforms the PostCss AST **safely**.
|
---|
| 6 |
|
---|
| 7 | [PostCSS]: https://github.com/postcss/postcss
|
---|
| 8 |
|
---|
| 9 | ```css
|
---|
| 10 | @-webkit-keyframes fade-in {
|
---|
| 11 | 0% {
|
---|
| 12 | opacity: 0;
|
---|
| 13 | }
|
---|
| 14 | 100% {
|
---|
| 15 | opacity: 0.8;
|
---|
| 16 | }
|
---|
| 17 | }
|
---|
| 18 | @keyframes fade-in {
|
---|
| 19 | 0% {
|
---|
| 20 | opacity: 0;
|
---|
| 21 | }
|
---|
| 22 | 100% {
|
---|
| 23 | opacity: 0.8;
|
---|
| 24 | }
|
---|
| 25 | }
|
---|
| 26 | @media (max-width: 500px) {
|
---|
| 27 | @-webkit-keyframes fade-in {
|
---|
| 28 | 0% {
|
---|
| 29 | opacity: 0;
|
---|
| 30 | }
|
---|
| 31 | 100% {
|
---|
| 32 | opacity: 1;
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
| 35 | @keyframes fade-in {
|
---|
| 36 | 0% {
|
---|
| 37 | opacity: 0;
|
---|
| 38 | }
|
---|
| 39 | 100% {
|
---|
| 40 | opacity: 1;
|
---|
| 41 | }
|
---|
| 42 | }
|
---|
| 43 | @-webkit-keyframes fade-in {
|
---|
| 44 | 0% {
|
---|
| 45 | opacity: 0;
|
---|
| 46 | }
|
---|
| 47 | 100% {
|
---|
| 48 | opacity: 0.8;
|
---|
| 49 | }
|
---|
| 50 | }
|
---|
| 51 | @keyframes fade-in {
|
---|
| 52 | 0% {
|
---|
| 53 | opacity: 0;
|
---|
| 54 | }
|
---|
| 55 | 100% {
|
---|
| 56 | opacity: 0.8;
|
---|
| 57 | }
|
---|
| 58 | }
|
---|
| 59 | @supports (display: flex) {
|
---|
| 60 | @-webkit-keyframes fade-in {
|
---|
| 61 | 0% {
|
---|
| 62 | opacity: 0;
|
---|
| 63 | }
|
---|
| 64 | 100% {
|
---|
| 65 | opacity: 1;
|
---|
| 66 | }
|
---|
| 67 | }
|
---|
| 68 | @keyframes fade-in {
|
---|
| 69 | 0% {
|
---|
| 70 | opacity: 0;
|
---|
| 71 | }
|
---|
| 72 | 100% {
|
---|
| 73 | opacity: 1;
|
---|
| 74 | }
|
---|
| 75 | }
|
---|
| 76 | }
|
---|
| 77 | }
|
---|
| 78 | @-webkit-keyframes fade-in {
|
---|
| 79 | 0% {
|
---|
| 80 | opacity: 0;
|
---|
| 81 | }
|
---|
| 82 | 100% {
|
---|
| 83 | opacity: 1;
|
---|
| 84 | }
|
---|
| 85 | }
|
---|
| 86 | @keyframes fade-in {
|
---|
| 87 | 0% {
|
---|
| 88 | opacity: 0;
|
---|
| 89 | }
|
---|
| 90 | 100% {
|
---|
| 91 | opacity: 1;
|
---|
| 92 | }
|
---|
| 93 | }
|
---|
| 94 | ```
|
---|
| 95 |
|
---|
| 96 | ```css
|
---|
| 97 | @media (max-width: 500px) {
|
---|
| 98 | @-webkit-keyframes fade-in {
|
---|
| 99 | 0% {
|
---|
| 100 | opacity: 0;
|
---|
| 101 | }
|
---|
| 102 | 100% {
|
---|
| 103 | opacity: 0.8;
|
---|
| 104 | }
|
---|
| 105 | }
|
---|
| 106 | @keyframes fade-in {
|
---|
| 107 | 0% {
|
---|
| 108 | opacity: 0;
|
---|
| 109 | }
|
---|
| 110 | 100% {
|
---|
| 111 | opacity: 0.8;
|
---|
| 112 | }
|
---|
| 113 | }
|
---|
| 114 | @supports (display: flex) {
|
---|
| 115 | @-webkit-keyframes fade-in {
|
---|
| 116 | 0% {
|
---|
| 117 | opacity: 0;
|
---|
| 118 | }
|
---|
| 119 | 100% {
|
---|
| 120 | opacity: 1;
|
---|
| 121 | }
|
---|
| 122 | }
|
---|
| 123 | @keyframes fade-in {
|
---|
| 124 | 0% {
|
---|
| 125 | opacity: 0;
|
---|
| 126 | }
|
---|
| 127 | 100% {
|
---|
| 128 | opacity: 1;
|
---|
| 129 | }
|
---|
| 130 | }
|
---|
| 131 | }
|
---|
| 132 | }
|
---|
| 133 | @-webkit-keyframes fade-in {
|
---|
| 134 | 0% {
|
---|
| 135 | opacity: 0;
|
---|
| 136 | }
|
---|
| 137 | 100% {
|
---|
| 138 | opacity: 1;
|
---|
| 139 | }
|
---|
| 140 | }
|
---|
| 141 | @keyframes fade-in {
|
---|
| 142 | 0% {
|
---|
| 143 | opacity: 0;
|
---|
| 144 | }
|
---|
| 145 | 100% {
|
---|
| 146 | opacity: 1;
|
---|
| 147 | }
|
---|
| 148 | }
|
---|
| 149 | ```
|
---|
| 150 |
|
---|
| 151 | ## Usage
|
---|
| 152 |
|
---|
| 153 | See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
---|
| 154 | examples for your environment.
|
---|
| 155 |
|
---|
| 156 | ## Contributors
|
---|
| 157 |
|
---|
| 158 | See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
---|
Note:
See
TracBrowser
for help on using the repository browser.