Skip to content

Commit bd3376d

Browse files
authored
Merge pull request #2146 from anuradha9712/feat-opacity-tokens-in-components
feat(opacity): update values of opacity with tokens in components
2 parents 938a710 + e970195 commit bd3376d

20 files changed

Lines changed: 82 additions & 86 deletions

File tree

core/components/css-utilities/designTokens/Data.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,14 @@ export const transitionsDurationData = [
181181
];
182182

183183
export const opacityData = [
184-
{ token: '--opacity-0', value: '0' },
185-
{ token: '--opacity-4', value: '0.04' },
186-
{ token: '--opacity-8', value: '0.08' },
187-
{ token: '--opacity-12', value: '0.12' },
188-
{ token: '--opacity-16', value: '0.16' },
189-
{ token: '--opacity-24', value: '0.24' },
190-
{ token: '--opacity-32', value: '0.32' },
191-
{ token: '--opacity-40', value: '0.40' },
192-
{ token: '--opacity-48', value: '0.48' },
193-
{ token: '--opacity-64', value: '0.64' },
194-
{ token: '--opacity-80', value: '0.80' },
195-
{ token: '--opacity-100', value: '1' },
184+
{ token: '--opacity-1', value: '0.04' },
185+
{ token: '--opacity-2', value: '0.08' },
186+
{ token: '--opacity-3', value: '0.12' },
187+
{ token: '--opacity-4', value: '0.16' },
188+
{ token: '--opacity-6', value: '0.24' },
189+
{ token: '--opacity-8', value: '0.32' },
190+
{ token: '--opacity-10', value: '0.40' },
191+
{ token: '--opacity-12', value: '0.48' },
192+
{ token: '--opacity-16', value: '0.64' },
193+
{ token: '--opacity-20', value: '0.80' },
196194
];

css/src/components/actionCard.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@
3535
bottom: 0;
3636
left: 0;
3737
z-index: 2;
38-
opacity: 50%;
38+
opacity: var(--opacity-10);
3939
background: var(--secondary-light);
4040
}

css/src/components/backdrop.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
opacity: 0;
44
}
55
to {
6-
opacity: 60;
6+
opacity: var(--opacity-16);
77
}
88
}
99

1010
@keyframes backdrop-close {
1111
from {
12-
opacity: 60;
12+
opacity: var(--opacity-16);
1313
}
1414
to {
1515
opacity: 0;
1616
}
1717
}
1818

1919
.Backdrop {
20-
background-color: color-mod(var(--inverse) a(0.6));
20+
background-color: color-mod(var(--inverse) a(var(--opacity-16)));
2121
height: 100vh;
2222
width: 100vw;
2323
position: fixed;

css/src/components/fullscreenModal.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
transform: translateY(20px);
55
}
66
to {
7-
opacity: 100;
7+
opacity: 1;
88
transform: translateY(0px);
99
}
1010
}
1111

1212
@keyframes fullscreenModal-close {
1313
from {
14-
opacity: 100;
14+
opacity: 1;
1515
transform: translateY(0px);
1616
}
1717
to {

css/src/components/grid.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929

3030
.Grid--resource .Grid-row--body:focus {
31-
box-shadow: var(--shadow-spread) color-mod(var(--secondary) a(var(--opacity-16)));
31+
box-shadow: var(--shadow-spread) color-mod(var(--secondary) a(var(--opacity-4)));
3232
outline: none;
3333
}
3434

@@ -147,13 +147,13 @@
147147

148148
.Grid-row--selected,
149149
.Grid-row--selected .Grid-cellGroup {
150-
background: color-mod(var(--primary-lightest) a(var(--opacity-48)));
150+
background: color-mod(var(--primary-lightest) a(var(--opacity-12)));
151151
transition: var(--duration--fast-02) var(--standard-productive-curve);
152152
}
153153

154154
.Grid-row--selected:hover,
155155
.Grid-row--selected .Grid-cellGroup:hover {
156-
background: color-mod(var(--primary-lighter) a(var(--opacity-48))) !important;
156+
background: color-mod(var(--primary-lighter) a(var(--opacity-12))) !important;
157157
}
158158

159159
.Grid-row--selected:active,
@@ -164,7 +164,7 @@
164164
.Grid-row--selected:focus,
165165
.Grid-row--selected .Grid-cellGroup:focus {
166166
outline: none;
167-
box-shadow: var(--shadow-spread) color-mod(var(--primary) a(var(--opacity-16)));
167+
box-shadow: var(--shadow-spread) color-mod(var(--primary) a(var(--opacity-4)));
168168
}
169169

170170
.Grid-rowWrapper:last-child .Grid-row--body {
@@ -243,7 +243,7 @@
243243
} */
244244

245245
.Grid-row--disabled {
246-
opacity: var(--opacity-40);
246+
opacity: var(--opacity-10);
247247
pointer-events: none;
248248
}
249249

css/src/components/horizontalNav.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@
8181
}
8282

8383
.HorizontalNav-pills--disabled {
84-
opacity: 0.6;
84+
opacity: var(--opacity-10);
8585
}

css/src/components/listbox.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@
5959
}
6060

6161
.Listbox-item--selected {
62-
background: color-mod(var(--primary-lightest) a(var(--opacity-48)));
62+
background: color-mod(var(--primary-lightest) a(var(--opacity-12)));
6363
}
6464

6565
.Listbox-item--selected:hover {
66-
background: color-mod(var(--primary-lighter) a(var(--opacity-48)));
66+
background: color-mod(var(--primary-lighter) a(var(--opacity-12)));
6767
}
6868

6969
.Listbox-item--selected:focus,
@@ -108,7 +108,7 @@
108108
/* Listbox type - disabled */
109109

110110
.Listbox-item--disabled {
111-
opacity: var(--opacity-40);
111+
opacity: var(--opacity-10);
112112
pointer-events: none;
113113
}
114114

css/src/components/message.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111

1212
.Message--alert {
1313
border-color: var(--alert);
14-
background-color: color-mod(var(--alert-lightest) a(0.4));
14+
background-color: color-mod(var(--alert-lightest) a(var(--opacity-10)));
1515
}
1616

1717
.Message--success {
1818
border-color: var(--success);
19-
background-color: color-mod(var(--success-lightest) a(0.4));
19+
background-color: color-mod(var(--success-lightest) a(var(--opacity-10)));
2020
}
2121

2222
.Message--info {
2323
border-color: var(--primary);
24-
background-color: color-mod(var(--primary-lightest) a(0.4));
24+
background-color: color-mod(var(--primary-lightest) a(var(--opacity-10)));
2525
}
2626

2727
.Message--warning {
2828
border-color: var(--accent1);
29-
background-color: color-mod(var(--warning-lightest) a(0.4));
29+
background-color: color-mod(var(--warning-lightest) a(var(--opacity-10)));
3030
}
3131

3232
.Message-icon {

css/src/components/navigation.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
}
103103

104104
.Navigation-horizontalPills--disabled {
105-
opacity: 0.6;
105+
opacity: var(--opacity-10);
106106
}
107107

108108
.Navigation-footer {

css/src/components/popover.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
opacity: 0;
2222
}
2323
80% {
24-
opacity: 0.2;
24+
opacity: var(--opacity-6);
2525
}
2626
100% {
2727
opacity: 1;

0 commit comments

Comments
 (0)