Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: standardize focus outline style #119

Merged
merged 1 commit into from
Mar 28, 2024
Merged
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
24 changes: 24 additions & 0 deletions common/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $n: none;
$i: !important;
$--global-nav-height: 38px;
$--dark-blue: #002ead;
$--blue-50: #198eee;
$header_primary: #fff;
$header_background: #0a0a23;
$--gray90: mix($header_background, $header_primary, 100%);
Expand Down Expand Up @@ -94,12 +95,29 @@ $breakpoints: (
@import url("https://fonts.googleapis.com/css?family=Lato:400,400i,700");
@import url("https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i,700");

// focus outline mixin ---------------------------------------------------------------

@mixin focus-outline {
outline: 3px solid $--blue-50 $i;
outline-offset: 0 $i;
}
Comment on lines +100 to +103
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// general ---------------------------------------------------------------
html {
font-family: "Lato", sans-serif;
font-size: 18px;
}

:focus-visible {
@include focus-outline;
}

@supports not selector(:focus-visible) {
:focus {
@include focus-outline;
}
}

/* Footer ---------------------------------------------------------- */
.site-footer {
position: relative;
Expand Down Expand Up @@ -793,6 +811,12 @@ div.select-kit-header {
}
}

.topic-list .main-link {
&.focused {
box-shadow: none $i; /* Unset the default Discourse styles */
}
}
Comment on lines +814 to +818
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discourse adds a blue stripe to the left edge of a focused item. We don't need it as we want to use our own styles.


.topic-timer-heading > span {
display: none;
}
Expand Down
Loading