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

WHCM styles improvements #455

Merged
merged 3 commits into from
Feb 6, 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
11 changes: 9 additions & 2 deletions wagtailio/static/sass/components/_cta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
> svg {
transition: transform 0.3s;
margin: 0 0 0 auto;
flex-shrink: 0
flex-shrink: 0;

@media (forced-colors: active) {
shyusu4 marked this conversation as resolved.
Show resolved Hide resolved
fill: currentColor;
}
}

&:hover {
Expand All @@ -42,13 +46,16 @@
> svg {
fill: $color--white;
transform: translateX(10px) scale(1.1);

shyusu4 marked this conversation as resolved.
Show resolved Hide resolved
@media (forced-colors: active) {
fill: currentColor;
}
}
}

&__title {
color: var(--color--interaction);
margin-bottom: 10px;
transition: color $transition;
shyusu4 marked this conversation as resolved.
Show resolved Hide resolved

@include media-query(medium) {
margin-bottom: 5px;
Expand Down
6 changes: 5 additions & 1 deletion wagtailio/static/sass/components/_nav-cta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
bottom: 30px;
right: 20px;
stroke: $color--white;
stroke-width: 1px;
stroke-width: 4px;

Choose a reason for hiding this comment

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

Here we're affecting designs in a non-contrast mode, we need to add media query to target forced-colors only

Choose a reason for hiding this comment

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

The stroke: currentColor does not seem to have any effect on the regular rendering. In my opinion the stroke-width increase would be an improvement to the base design, it's not my place to decide that, so I agree with Albina's suggestion to move these rules into a media query.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @Scotchester @albinazs - I've moved the use of currentColor into a media query, but left stroke-width because this is part of another minor issue in the audit. I think it would be better to keep the increased width so that the nav CTA is more distinguishable as a link.

Choose a reason for hiding this comment

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

Ah, gotcha! If we are considering the thin stroke an accessibility issue as well, then I am happy to have the change :)

fill: transparent;
width: 60px;
height: 60px;
Expand All @@ -104,6 +104,10 @@
bottom: 50px;
right: 60px;
}

@media (forced-colors: active) {
stroke: currentColor;
}
}
}

2 changes: 1 addition & 1 deletion wagtailio/static/sass/components/_theme-toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

// Don't display toggle if in high contrast mode
@media (prefers-contrast: more) {
@media (forced-colors: active) {
display: none;
}

Expand Down
5 changes: 4 additions & 1 deletion wagtailio/static/sass/layout/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

&__icon {
fill: transparent;
stroke: $color--white;
stroke: currentColor;
stroke-width: 3px;
width: 45px;
height: 50px;
Expand Down Expand Up @@ -176,6 +176,9 @@
transition: fill $transition;
}

@media (forced-colors: active) {
fill: currentColor;
shyusu4 marked this conversation as resolved.
Show resolved Hide resolved
}
}

&__survey-link {
Expand Down
4 changes: 4 additions & 0 deletions wagtailio/static/sass/vendor/_code-highlighting.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
white-space: pre-wrap;
padding: 1em;
font-size: 0.85em;

@media (forced-colors: active) {
border: 1px solid;
}
}

.codehilite *{
Expand Down
Loading