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 focus visibility in theme settings #245

Merged
merged 8 commits into from
Aug 5, 2024
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
4 changes: 2 additions & 2 deletions scripts/compile_styles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ compile_components() {

replace_rem_w_em () {
echo "Replacing REMs with EMs..."
sed -i -r "s|([0-9])rem|\1em|g" "$1"
sed -i.bak -E "s|([0-9])rem|\1em|g" "$1" && rm "$1.bak"
if [ $? -ne 0 ]; then
echo "Failed to replace REMs with EMs in $1... Aborting."
exit 1
Expand All @@ -118,4 +118,4 @@ format_bootstrap () {
# Call the functions
compile_components
compile_bootstrap
exit $?
exit $?
4 changes: 4 additions & 0 deletions src/scss/_bootstrap-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ $warning: $cod-accent-yellow !default;
$danger: #b3393b !default;
$light: #fff !default;
$dark: #000 !default;

$focus-ring-width: 0.25rem;
$focus-ring-opacity: 1;
$focus-ring-color: blue;
17 changes: 17 additions & 0 deletions src/scss/_detroitmi-style-guide.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,20 @@ h6,
.h6 {
font-weight: 900;
}

.btn {
--bs-btn-focus-box-shadow: 0 0 0 0.25em
rgba(var(--bs-btn-focus-shadow-rgb), 1);
}

.btn:focus-visible {
--bs-btn-focus-shadow-rgb: 0, 0, 255;
}

// Define focus box-shadow for buttons
@each $color, $value in $theme-colors {
$focus-shadow-rgb: to-rgb($focus-ring-color);
.btn-#{$color} {
--#{$prefix}btn-focus-shadow-rgb: #{$focus-shadow-rgb};
}
}
87 changes: 68 additions & 19 deletions src/shared/themed-bootstrap.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/shared/themed-bootstrap.css.map

Large diffs are not rendered by default.

Loading