Skip to content

Commit aa2f37e

Browse files
author
Alexis Córdova
authored
fix(button): Add Icon Styling Hook to Button with Icon (#4975)
1 parent 83e1c72 commit aa2f37e

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

RELEASENOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<!-- Release notes authoring guidelines: http://keepachangelog.com/ -->
22
<!-- !!! THIS FILE IS AUTO-GENERATED !!! DO NOT EDIT THIS FILE MANUALLY !!! -->
33

4+
## Release 2.17.2 - January 19, 2022
5+
6+
## Components
7+
### [Buttons](https://www.lightningdesignsystem.com/components/buttons)
8+
#### Added
9+
- Added `--slds-c-icon-color-foreground` Styling Hook to Button with Icon variant to accurately apply icon color updates
10+
- Due to how the Lightning Base Component is configured, this is required to allow CSS Custom Property reassignment to function within Button Icons
11+
412
## Release 2.17.1 - January 6, 2021
513

614
## Components

ui/components/button-icons/base/example.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import React from 'react';
55
import ButtonIcon, { HintParent } from '../';
6+
import {Button} from '../../buttons/base/example';
7+
import SvgIcon from '../../../shared/svg-icon';
68

79
export default [
810
{
@@ -57,5 +59,18 @@ export let examples = [
5759
/>
5860
</HintParent>
5961
)
62+
},
63+
{
64+
id: 'button-icon-lbc-mismatch',
65+
label: 'Button Icon - LBC Mismatch',
66+
element: (
67+
<Button className="slds-button_icon slds-button_icon-border">
68+
<SvgIcon
69+
sprite="utility"
70+
symbol="clock"
71+
className="slds-button__icon slds-icon-text-error"
72+
/>
73+
</Button>
74+
)
6075
}
6176
];

ui/components/buttons/RELEASENOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44

55
<!-- ## [Unreleased] -->
66

7+
## 2.17.2
8+
9+
### Added
10+
- Added `--slds-c-icon-color-foreground` Styling Hook to Button with Icon variant to accurately apply icon color updates
11+
- Due to how the Lightning Base Component is configured, this is required to allow CSS Custom Property reassignment to function within Button Icons
712
## 2.17.0
813

914
### Added
1015
- Added Styling Hooks for Stateful Button and Dual Stateful Button.
1116
- Added missing `slds`-namespaced Styling Hooks (originally added in 2.16.0)
17+
1218
## 2.16.0
1319

1420
### Added

ui/components/buttons/base/_index.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ a.slds-button--inverse:focus {
569569
*/
570570
.slds-button__icon {
571571
@include square($square-icon-medium-content-alt);
572-
fill: currentColor;
572+
// Aura and LBC Button Icon components were created with a mix of approaches: partially with how Button Icon works and partially with Button _with_ Icon. Because of this, state classes (success/warning/error) within a Button Icon would never get the correct color, as this previously was hardcoded to `currentColor`. This is the least-invasive approach for remediation.
573+
fill: var(--slds-c-icon-color-foreground, currentColor);
573574
}
574575

575576
/**

0 commit comments

Comments
 (0)