Skip to content

Commit

Permalink
feat(odyssey-react): add :focus state to Link
Browse files Browse the repository at this point in the history
  • Loading branch information
edburyenegren-okta committed Mar 8, 2022
1 parent 8f29d89 commit 28cf97f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/odyssey-react/src/components/Link/Link.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
*/

.root {
@include border-radius(var(--BorderRadius));

color: var(--TextColor);
text-decoration: none;

Expand All @@ -19,6 +21,13 @@
text-decoration: underline;
}

&:focus {
outline-color: var(--FocusOutlineColor);
outline-offset: var(--FocusOutlineOffset);
outline-style: var(--FocusOutlineStyle);
outline-width: var(--FocusOutlineWidth);
}

&:visited {
color: var(--TextColor);
}
Expand Down
8 changes: 8 additions & 0 deletions packages/odyssey-react/src/components/Link/Link.theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@
import type { ThemeReducer } from "@okta/odyssey-react-theme";

export const theme: ThemeReducer = (theme) => ({
BorderRadius: theme.BorderRadiusBase,

// Primary Variant
TextColor: theme.ColorTextPrimary,

// Secondary Variant
SecondaryTextColor: theme.ColorTextBody,

// Focus
FocusOutlineColor: theme.FocusOutlineColorPrimary,
FocusOutlineOffset: theme.FocusOutlineOffsetBase,
FocusOutlineStyle: theme.FocusOutlineStyle,
FocusOutlineWidth: theme.FocusOutlineWidthTight,

// Space
IndicatorMarginInlineStart: theme.SpaceScale1,
IconMarginInlineEnd: theme.SpaceScale1,
Expand Down

0 comments on commit 28cf97f

Please sign in to comment.