Skip to content

Commit 4331e86

Browse files
committed
add specific button border tokens for icon buttons
1 parent f3a8930 commit 4331e86

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
### Improvements
44

55
- **Toggle**: tokenize toggle style, so it can be easily overridden
6+
- **Buttons**: add specific button border tokens for icon buttons
67

78
### Bug fixes
9+
810
- **Text fields**:
911
- go back to normal border of fields, as the custom border top trick was not working well and preventing to use bigger border-radius
1012
- use same border-radius inside the input as in the field to prevent input background color to go over the borders

projects/pastanaga-angular/src/styles/theme/_button.tokens.scss

+83-1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ $border-button-primary-basic: none !default;
109109
$border-button-primary-basic-hover: none !default;
110110
$border-button-primary-basic-active: none !default;
111111

112+
$border-button-icon-primary-basic: none !default;
113+
$border-button-icon-primary-basic-hover: none !default;
114+
$border-button-icon-primary-basic-active: none !default;
115+
112116
// secondary
113117
$border-button-secondary-solid: none !default;
114118
$border-button-secondary-solid-hover: none !default;
@@ -118,6 +122,10 @@ $border-button-secondary-basic: none !default;
118122
$border-button-secondary-basic-hover: none !default;
119123
$border-button-secondary-basic-active: none !default;
120124

125+
$border-button-icon-secondary-basic: none !default;
126+
$border-button-icon-secondary-basic-hover: none !default;
127+
$border-button-icon-secondary-basic-active: none !default;
128+
121129
// inverted
122130
$border-button-inverted-solid: none !default;
123131
$border-button-inverted-solid-hover: none !default;
@@ -127,6 +135,10 @@ $border-button-inverted-basic: none !default;
127135
$border-button-inverted-basic-hover: none !default;
128136
$border-button-inverted-basic-active: none !default;
129137

138+
$border-button-icon-inverted-basic: none !default;
139+
$border-button-icon-inverted-basic-hover: none !default;
140+
$border-button-icon-inverted-basic-active: none !default;
141+
130142
// destructive
131143
$border-button-destructive-solid: none !default;
132144
$border-button-destructive-solid-hover: none !default;
@@ -136,9 +148,15 @@ $border-button-destructive-basic: none !default;
136148
$border-button-destructive-basic-hover: none !default;
137149
$border-button-destructive-basic-active: none !default;
138150

151+
$border-button-icon-destructive-basic: none !default;
152+
$border-button-icon-destructive-basic-hover: none !default;
153+
$border-button-icon-destructive-basic-active: none !default;
154+
139155
// disabled
140156
$border-button-solid-disabled: none !default;
141157
$border-button-basic-disabled: none !default;
158+
$border-button-icon-basic-disabled: none !default;
159+
$border-button-inverted-basic-disabled: none !default;
142160

143161
// radius
144162
$border-radius-button: 100px !default;
@@ -215,6 +233,20 @@ $font-weight-button-label: $font-weight-semi-bold !default;
215233
background: $color-background-button-primary-basic-active;
216234
border: $border-button-primary-basic-active;
217235
}
236+
237+
&.pa-button-icon {
238+
border: $border-button-icon-primary-basic;
239+
240+
@media (hover: hover) {
241+
&:hover {
242+
border: $border-button-icon-primary-basic-hover;
243+
}
244+
}
245+
&:active,
246+
&.pa-active {
247+
border: $border-button-icon-primary-basic-active;
248+
}
249+
}
218250
}
219251

220252
@mixin secondary-solid() {
@@ -257,6 +289,20 @@ $font-weight-button-label: $font-weight-semi-bold !default;
257289
background: $color-background-button-secondary-basic-active;
258290
border: $border-button-secondary-basic-active;
259291
}
292+
293+
&.pa-button-icon {
294+
border: $border-button-icon-secondary-basic;
295+
296+
@media (hover: hover) {
297+
&:hover {
298+
border: $border-button-icon-secondary-basic-hover;
299+
}
300+
}
301+
&:active,
302+
&.pa-active {
303+
border: $border-button-icon-secondary-basic-active;
304+
}
305+
}
260306
}
261307

262308
@mixin inverted-solid() {
@@ -299,6 +345,20 @@ $font-weight-button-label: $font-weight-semi-bold !default;
299345
background: $color-background-button-inverted-basic-active;
300346
border: $border-button-inverted-basic-active;
301347
}
348+
349+
&.pa-button-icon {
350+
border: $border-button-icon-inverted-basic;
351+
352+
@media (hover: hover) {
353+
&:hover {
354+
border: $border-button-icon-inverted-basic-hover;
355+
}
356+
}
357+
&:active,
358+
&.pa-active {
359+
border: $border-button-icon-inverted-basic-active;
360+
}
361+
}
302362
}
303363

304364
@mixin destructive-solid() {
@@ -341,6 +401,20 @@ $font-weight-button-label: $font-weight-semi-bold !default;
341401
background: $color-background-button-destructive-basic-active;
342402
border: $border-button-destructive-basic-active;
343403
}
404+
405+
&.pa-button-icon {
406+
border: $border-button-icon-destructive-basic;
407+
408+
@media (hover: hover) {
409+
&:hover {
410+
border: $border-button-icon-destructive-basic-hover;
411+
}
412+
}
413+
&:active,
414+
&.pa-active {
415+
border: $border-button-icon-destructive-basic-active;
416+
}
417+
}
344418
}
345419

346420
@mixin disabled-solid() {
@@ -353,6 +427,10 @@ $font-weight-button-label: $font-weight-semi-bold !default;
353427
color: $color-text-button-basic-disabled;
354428
background: $color-background-button-basic-disabled;
355429
border: $border-button-basic-disabled;
430+
431+
&.pa-button-icon {
432+
border: $border-button-icon-basic-disabled;
433+
}
356434
}
357435

358436
@mixin disabled-inverted-solid() {
@@ -364,7 +442,11 @@ $font-weight-button-label: $font-weight-semi-bold !default;
364442
@mixin disabled-inverted-basic() {
365443
color: $color-text-button-inverted-basic-disabled;
366444
background: $color-background-button-basic-disabled;
367-
border: $border-button-basic-disabled;
445+
border: $border-button-inverted-basic-disabled;
446+
447+
&.pa-button-icon {
448+
border: $border-button-icon-basic-disabled;
449+
}
368450
}
369451

370452
@mixin hover-box-shadow-solid() {

0 commit comments

Comments
 (0)