|
24 | 24 | color: var(--main-purple); |
25 | 25 | background: transparent; |
26 | 26 | outline: none; |
27 | | - overflow: hidden; |
28 | 27 | transition-property: border, color, background-color; |
29 | | - transition-duration: var(--short); |
| 28 | + transition-duration: 0.2s; |
30 | 29 | transition-timing-function: ease; |
31 | 30 | } |
32 | 31 |
|
33 | | -.crm__add-btn:focus-visible:not(:hover) { |
34 | | - color: var(--white); |
35 | | - background-color: var(--dark-purple); |
36 | | -} |
37 | | - |
38 | | -.crm__add-btn:focus-visible:not(:hover) .default-add-icon { |
39 | | - opacity: 0; |
| 32 | +.crm__add-btn::before, |
| 33 | +.crm__add-btn::after { |
| 34 | + content: ""; |
| 35 | + position: absolute; |
| 36 | + left: 22px; |
| 37 | + width: 22px; |
| 38 | + height: 16px; |
| 39 | + background-repeat: no-repeat; |
| 40 | + background-position: center; |
| 41 | + background-size: contain; |
| 42 | + transition: opacity 0.2s ease; |
40 | 43 | } |
41 | 44 |
|
42 | | -.crm__add-btn:focus-visible:not(:hover) .white-add-icon { |
| 45 | +.crm__add-btn::before { |
| 46 | + background-image: url('../images/add-client.svg'); |
43 | 47 | opacity: 1; |
44 | 48 | } |
45 | 49 |
|
46 | | -.crm__add-btn:focus-visible:active { |
47 | | - color: var(--gray); |
48 | | -} |
49 | | - |
50 | | -.crm__add-btn:active { |
51 | | - border: 1px solid var(--gray); |
52 | | - color: var(--gray); |
53 | | - background-color: transparent; |
54 | | -} |
55 | | - |
56 | | -.crm__add-btn:active .default-add-icon { |
| 50 | +.crm__add-btn::after { |
57 | 51 | opacity: 0; |
58 | 52 | } |
59 | 53 |
|
60 | | -.crm__add-btn:active .gray-add-icon { |
| 54 | +.crm__add-btn:focus-visible::after { |
| 55 | + background-image: url('../images/add-client-white.svg'); |
61 | 56 | opacity: 1; |
62 | 57 | } |
63 | 58 |
|
64 | | -.crm__add-btn-icon { |
65 | | - position: absolute; |
66 | | - left: 27px; |
67 | | - width: 22px; |
68 | | - height: 16px; |
69 | | - transition: opacity var(--short) ease; |
| 59 | +.crm__add-btn:active::after { |
| 60 | + background-image: url('../images/add-client-gray.svg'); |
| 61 | + opacity: 1; |
70 | 62 | } |
71 | 63 |
|
72 | | -.default-add-icon { |
73 | | - background: url('../images/add-client.svg') no-repeat center / contain; |
74 | | - opacity: 1; |
| 64 | +.crm__add-btn:focus-visible:not(:hover) { |
| 65 | + color: var(--white); |
| 66 | + background-color: var(--dark-purple); |
75 | 67 | } |
76 | 68 |
|
77 | | -.white-add-icon { |
78 | | - background: url('../images/add-client-white.svg') no-repeat center / contain; |
79 | | - opacity: 0; |
| 69 | +.crm__add-btn:focus-visible:active { |
| 70 | + color: var(--gray); |
80 | 71 | } |
81 | 72 |
|
82 | | -.gray-add-icon { |
83 | | - background: url('../images/add-client-gray.svg') no-repeat center / contain; |
84 | | - opacity: 0; |
| 73 | +.crm__add-btn:active { |
| 74 | + border: 1px solid var(--gray); |
| 75 | + color: var(--gray); |
| 76 | + background-color: transparent; |
85 | 77 | } |
86 | 78 |
|
87 | 79 | /* media queries, any-hover */ |
|
92 | 84 | background-color: var(--light-purple); |
93 | 85 | } |
94 | 86 |
|
95 | | - .crm__add-btn:hover:not(:active) .default-add-icon { |
| 87 | + .crm__add-btn:hover::before { |
96 | 88 | opacity: 0; |
97 | 89 | } |
98 | 90 |
|
99 | | - .crm__add-btn:hover:not(:active) .white-add-icon { |
| 91 | + .crm__add-btn:hover:not(:active)::after { |
| 92 | + background-image: url('../images/add-client-white.svg'); |
100 | 93 | opacity: 1; |
101 | 94 | } |
102 | 95 | } |
0 commit comments