Skip to content

Commit 90ca046

Browse files
authored
chore(styling-hooks): refactor new focus styling hooks (#5330)
1 parent 4b88020 commit 90ca046

File tree

67 files changed

+112
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+112
-178
lines changed

styling-hooks/shadow.json

Lines changed: 0 additions & 72 deletions
This file was deleted.

styling-hooks/slds-hooks.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"imports": [
33
"@salesforce-ux/sds-styling-hooks/src/props/colors.json",
44
"@salesforce-ux/sds-styling-hooks/src/props/palettes.json",
5-
"./transparent-colors.json",
6-
"./shadow.json"
5+
"./transparent-colors.json"
76
]
87
}

ui/_styling-hooks.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@
66
// ----------------------------------------------------------------------------
77

88
@import '../design-tokens/dist/slds-hooks.custom-props';
9+
10+
:root {
11+
--_slds-g-shadow-outset-focus: 0 0 0 2px var(--slds-g-color-neutral-base-100, #FFFFFF), 0 0 0 4px var(--slds-g-color-brand-base-40, #0B5CAB);
12+
--_slds-g-shadow-inset-focus: 0 0 0 2px var(--slds-g-color-neutral-base-100) inset, 0 0 0 4px var(--slds-g-color-brand-base-40, #0B5CAB) inset;
13+
--_slds-g-shadow-inset-inverse-focus: 0 0 0 2px var(--slds-g-color-brand-base-40, #0B5CAB) inset, 0 0 0 4px var(--slds-g-color-neutral-base-100, #FFFFFF) inset;
14+
--_slds-g-shadow-outline-focus: 0 0 0 2px var(--slds-g-color-brand-base-40, #0B5CAB);
15+
}

ui/components/accordion/base/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
line-height: var(--slds-c-accordion-heading-line-height, var(--sds-c-accordion-heading-line-height, $line-height-heading));
7575

7676
.slds-button:focus {
77-
box-shadow: inset var(--slds-g-shadow-8);
77+
box-shadow: inset var(--_slds-g-shadow-outline-focus);
7878
}
7979
}
8080

ui/components/alert/base/_index.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ $alert-gradient-size-background: 64px 64px;
4545
}
4646

4747
&:focus {
48-
box-shadow: var(--slds-c-alert-shadow, var(--slds-g-shadow-5, #{$shadow-button-focus}));
48+
box-shadow: var(--slds-c-alert-shadow, var(--_slds-g-shadow-outset-focus, #{$shadow-button-focus}));
4949
border-width: var(--slds-c-alert-sizing-border, $border-width-thin);
5050
border-style: solid;
5151
border-color: var(--slds-c-alert-color-border, transparent);
@@ -87,7 +87,7 @@ $alert-gradient-size-background: 64px 64px;
8787
}
8888

8989
.slds-button:focus {
90-
box-shadow: var(--slds-g-shadow-6);
90+
box-shadow: var(--_slds-g-shadow-inset-focus);
9191
}
9292
}
9393

ui/components/app-launcher/base/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828

2929
&:focus {
30-
box-shadow: var(--slds-g-shadow-5, #{$shadow-button-focus});
30+
box-shadow: var(--_slds-g-shadow-outset-focus, #{$shadow-button-focus});
3131
}
3232

3333
/**

ui/components/builder-header/base/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
&:focus {
8686
text-decoration: underline;
87-
box-shadow: var(--slds-g-shadow-7, #{$shadow-button-focus});
87+
box-shadow: var(--_slds-g-shadow-inset-inverse-focus, #{$shadow-button-focus});
8888
outline: none;
8989
border-radius: 0;
9090
}

ui/components/button-groups/base/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
box-shadow: inset 1px 0 0 var(--slds-g-color-neutral-base-100, #{$button-icon-color-border-primary});
3939

4040
&:focus {
41-
box-shadow: var(--slds-g-shadow-5);
41+
box-shadow: var(--_slds-g-shadow-outset-focus);
4242
}
4343
}
4444

ui/components/button-icons/base/_index.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
}
106106

107107
&:focus {
108-
box-shadow: var(--slds-g-shadow-5);
108+
box-shadow: var(--_slds-g-shadow-outset-focus);
109109
outline: 0;
110110
}
111111
}
@@ -148,7 +148,7 @@
148148
}
149149

150150
&:focus {
151-
box-shadow: var(--slds-g-shadow-6, #{$shadow-button-focus});
151+
box-shadow: var(--_slds-g-shadow-inset-focus, #{$shadow-button-focus});
152152
border-color: transparent;
153153
outline: 0;
154154
}

ui/components/button-icons/stateful/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
}
4747

4848
&:focus {
49-
box-shadow: var(--slds-g-shadow-5);
49+
box-shadow: var(--_slds-g-shadow-outset-focus);
5050
outline: 0;
5151
}
5252

0 commit comments

Comments
 (0)