Skip to content

Commit 96b1abd

Browse files
committed
website: Enhance accessibility for adopters button and main content area
1 parent 2f920cb commit 96b1abd

File tree

1 file changed

+51
-6
lines changed

1 file changed

+51
-6
lines changed

assets/scss/_styles_project.scss

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -929,23 +929,68 @@ nav.foldable-nav {
929929
color: #fff;
930930
}
931931

932-
#adopters .btn-outline-primary {
933-
color: $primary;
934-
border-color: $primary;
932+
// Adopters button: ensure 4.5:1+ contrast (light theme = dark blue on light bg)
933+
[data-theme="light"] #adopters .btn-outline-primary {
934+
color: #003d99;
935+
border-color: #003d99;
935936
font-weight: 500;
936937

937938
&:hover {
938939
color: #fff;
939-
background-color: $primary;
940-
border-color: $primary;
940+
background-color: #003d99;
941+
border-color: #003d99;
942+
}
943+
944+
&:focus-visible {
945+
outline: 2px solid #003d99;
946+
outline-offset: 2px;
947+
}
948+
}
949+
950+
// Adopters button: dark theme = light blue on dark bg
951+
[data-theme="dark"] #adopters .btn-outline-primary {
952+
color: #7eb8ff;
953+
border-color: #7eb8ff;
954+
font-weight: 500;
955+
956+
&:hover {
957+
color: #0d1117;
958+
background-color: #7eb8ff;
959+
border-color: #7eb8ff;
941960
}
942961

943962
&:focus-visible {
944-
outline: 2px solid $primary;
963+
outline: 2px solid #7eb8ff;
945964
outline-offset: 2px;
946965
}
947966
}
948967

968+
// Fallback when data-theme not set (e.g. no-JS)
969+
#adopters .btn-outline-primary {
970+
font-weight: 500;
971+
972+
&:focus-visible {
973+
outline: 2px solid currentColor;
974+
outline-offset: 2px;
975+
}
976+
}
977+
978+
// a11y: sufficient contrast for main content area (background and text)
979+
.td-main main {
980+
background-color: $body-bg;
981+
color: $body-color;
982+
}
983+
984+
[data-theme="light"] .td-main main {
985+
background-color: #ffffff;
986+
color: #212529;
987+
}
988+
989+
[data-theme="dark"] .td-main main {
990+
background-color: #0d1117;
991+
color: #e6edf3;
992+
}
993+
949994
// --------------------------------------------------
950995
// alert styling
951996
// --------------------------------------------------

0 commit comments

Comments
 (0)