1 | # keyframe-declaration-no-important
|
2 |
|
3 | Disallow `!important` within keyframe declarations.
|
4 |
|
5 |
|
6 | ```css
|
7 | @keyframes important2 {
|
8 | from { margin: 10px }
|
9 | to { margin: 20px !important }
|
10 | } /* ↑ */
|
11 | /** ↑
|
12 | * This !important */
|
13 | ```
|
14 |
|
15 | Using `!important` within keyframes declarations is completely ignored in some browsers:
|
16 | [MDN - !important in a keyframe](https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes#!important_in_a_keyframe)
|
17 |
|
18 | ## Options
|
19 |
|
20 | ### `true`
|
21 |
|
22 | The following patterns are considered violations:
|
23 |
|
24 |
|
25 | ```css
|
26 | @keyframes important1 {
|
27 | from {
|
28 | margin-top: 50px;
|
29 | }
|
30 | to {
|
31 | margin-top: 100px !important;
|
32 | }
|
33 | }
|
34 | ```
|
35 |
|
36 |
|
37 | ```css
|
38 | @keyframes important1 {
|
39 | from {
|
40 | margin-top: 50px;
|
41 | }
|
42 | to {
|
43 | margin-top: 100px!important;
|
44 | }
|
45 | }
|
46 | ```
|
47 |
|
48 |
|
49 | ```css
|
50 | @keyframes important1 {
|
51 | from {
|
52 | margin-top: 50px;
|
53 | }
|
54 | to {
|
55 | margin-top: 100px ! important;
|
56 | }
|
57 | }
|
58 | ```
|
59 |
|
60 | The following patterns are _not_ considered violations:
|
61 |
|
62 |
|
63 | ```css
|
64 | a { color: pink !important; }
|
65 | ```
|
66 |
|
67 |
|
68 | ```css
|
69 | @keyframes important1 {
|
70 | from {
|
71 | margin-top: 50px;
|
72 | }
|
73 | to {
|
74 | margin-top: 100px;
|
75 | }
|
76 | }
|
77 | ```
|