-
Notifications
You must be signed in to change notification settings - Fork 212
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
Use CSS for colors of VWordPress and VHomeLink #5110
base: main
Are you sure you want to change the base?
Conversation
Latest k6 run output1
Footnotes
|
Full-stack documentation: https://docs.openverse.org/_preview/5110 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
a7f134f
to
d894e3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run this locally, it looks like the WordPress, Openverse, and Exit buttons on the menu are all either pink on light mode, or yellow on dark mode. Is that what's expected? Between my local copy and staging, the only difference I can tell is that the WordPress logo goes from yellow on light mode to pink on light mode.
Based on the low urgency of this PR, the following reviewers are being gently reminded to review this PR: @krysal Excluding weekend1 days, this PR was ready for review 7 day(s) ago. PRs labelled with low urgency are expected to be reviewed within 5 weekday(s)2. @obulat, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings. Footnotes
|
Drafting until questions can be addressed. |
17f37d7
to
524e60d
Compare
788e44f
to
157391a
Compare
On light mode, I'm still seeing the Openverse logo, |
frontend/src/styles/tailwind.css
Outdated
@@ -565,6 +570,8 @@ Time - 11px - xs semibold (default leading-tight) | |||
|
|||
@apply after:pointer-events-none after:absolute after:inset-0 after:rounded-inherit; | |||
@apply after:z-10 after:shadow-bold-filled; /* inner-stroke: pseudo-element */ | |||
|
|||
@apply ring-[--color-focus-ring]; /* default ring color */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this work (since you already have the color defined in Tailwind config)?
@apply ring-[--color-focus-ring]; /* default ring color */ | |
@apply ring-focus-ring; /* default ring color */ |
In fact one could only define the new color --color-focus-rings
inside ringColor
so that it can be written as:
ringColor: {
focus: 'var(--color-focus-ring)',
// ...
}
@apply ring-focus;
/* ... */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @dhruvkb , I my understanding of how the CSS variables work with Tailwind was wrong.
I added ring-focus
and outline-focus
.
962a0d9
to
fa0ee8f
Compare
@@ -122,7 +122,9 @@ defineExpose({ | |||
v-bind="$attrs" | |||
class="flex flex-col" | |||
:class="[ | |||
mode === 'dark' ? 'bg-black text-default' : 'bg-overlay text-default', | |||
mode === 'dark' | |||
? 'dark-mode bg-black text-default' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dark
mode VModalContent
is manually set to dark-mode
so that the focus rings are yellow and don't change with the sites main color mode.
e11497b
to
0da15bd
Compare
8e94de2
to
3dff313
Compare
Fixes
Fixes #4998 by @obulat
Description
This PR adds CSS variables for the contrasting text color and for the focus ring color so that the logo elements (
VWordPressLink
andVHomeLink
) do not use JS to determine colors, even when the colors don't match the current color mode (i.e., on the pages modal, which has black background both in the dark and in the light themes).To prevent some of the focus styles overriding each other, I changed
focus-slim-tx
class to only apply onfocus-visible
. Otherwise, it changes the ring color not only for the element in question, but for child elements, and sometimes is difficult to override.Testing Instructions
Run the app using
ov just frontend/run dev
Open http://localhost:8443 in a narrow window, and click on the menu button in the top right corner. Use the keyboard to navigate though the contents. The focus rings should be yellow, in dark and in light themes. The WordPress and Openverse links should have correct colors.
Checklist
Update index.md
).main
) or a parent feature branch.ov just catalog/generate-docs
for catalogPRs) or the media properties generator (
ov just catalog/generate-docs media-props
for the catalog or
ov just api/generate-docs
for the API) where applicable.Developer Certificate of Origin
Developer Certificate of Origin