Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build-tools/utils/custom-css-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,10 @@ const customCssPropertiesList = [
'styleFocusRingBorderRadius',
'styleFocusRingBorderWidth',
'styleFocusRingBoxShadow',
// Alert focus ring properties
'alertFocusRingBorderColor',
'alertFocusRingBorderRadius',
'alertFocusRingBorderWidth',
'alertFocusRingBoxShadow',
];
module.exports = customCssPropertiesList;
6 changes: 3 additions & 3 deletions src/alert/__tests__/alert.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,17 @@ describe('Style API', () => {
expect(getComputedStyle(wrapper.findRootElement().getElement()).getPropertyValue('color')).toBe('rgb(0, 0, 0)');
expect(
getComputedStyle(wrapper.findRootElement().getElement()).getPropertyValue(
customCssProps.styleFocusRingBorderColor
customCssProps.alertFocusRingBorderColor
)
).toBe('rgb(23, 31, 118)');
expect(
getComputedStyle(wrapper.findRootElement().getElement()).getPropertyValue(
customCssProps.styleFocusRingBorderRadius
customCssProps.alertFocusRingBorderRadius
)
).toBe('6px');
expect(
getComputedStyle(wrapper.findRootElement().getElement()).getPropertyValue(
customCssProps.styleFocusRingBorderWidth
customCssProps.alertFocusRingBorderWidth
)
).toBe('4px');

Expand Down
6 changes: 3 additions & 3 deletions src/alert/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export function getAlertStyles(style: AlertProps['style']) {
borderWidth: style.root?.borderWidth,
color: style.root?.color,
...(style.root?.focusRing && {
[customCssProps.styleFocusRingBorderColor]: style.root.focusRing?.borderColor,
[customCssProps.styleFocusRingBorderRadius]: style.root.focusRing?.borderRadius,
[customCssProps.styleFocusRingBorderWidth]: style.root.focusRing?.borderWidth,
[customCssProps.alertFocusRingBorderColor]: style.root.focusRing?.borderColor,
[customCssProps.alertFocusRingBorderRadius]: style.root.focusRing?.borderRadius,
[customCssProps.alertFocusRingBorderWidth]: style.root.focusRing?.borderWidth,
}),
};
}
Expand Down
10 changes: 5 additions & 5 deletions src/alert/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
padding-inline: awsui.$space-alert-horizontal;
background-color: awsui.$color-background-container-content;

#{custom-props.$styleFocusRingBoxShadow}: 0 0 0
var(#{custom-props.$styleFocusRingBorderWidth}, foundation.$box-shadow-focused-width)
var(#{custom-props.$styleFocusRingBorderColor}, awsui.$color-border-item-focused);
#{custom-props.$alertFocusRingBoxShadow}: 0 0 0
var(#{custom-props.$alertFocusRingBorderWidth}, foundation.$box-shadow-focused-width)
var(#{custom-props.$alertFocusRingBorderColor}, awsui.$color-border-item-focused);
}

.alert-wrapper {
Expand Down Expand Up @@ -85,8 +85,8 @@
@include focus-visible.when-visible {
@include styles.focus-highlight(
$gutter: awsui.$space-button-focus-outline-gutter,
$border-radius: var(#{custom-props.$styleFocusRingBorderRadius}, awsui.$border-radius-control-default-focus-ring),
$box-shadow: var(#{custom-props.$styleFocusRingBoxShadow})
$border-radius: var(#{custom-props.$alertFocusRingBorderRadius}, awsui.$border-radius-control-default-focus-ring),
$box-shadow: var(#{custom-props.$alertFocusRingBoxShadow})
);
}
}
Expand Down
Loading