Comments (3)
We can adjust this function if we can decide at what luminance we need to change the link focus colors to black background and white text.
None of the light palette colors live up to the 3:1 or 4.5:1 contrast requirements when we measure the contrast between the color and the white link background.
public function body_class( $classes ) {
$background_color = get_theme_mod( 'background_color', 'D1E4DD' );
if ( 127 > self::get_relative_luminance_from_hex( $background_color ) ) {
$classes[] = 'is-dark-theme';
} else {
$classes[] = 'is-light-theme';
}
if ( 'ffffff' === strtolower( $background_color ) ) {
$classes[] = 'has-background-white';
}
return $classes;
}
-I don't believe the is-light-theme
class is used in the Customizer. It is a utility class and it is currently not used anywhere in the theme by default.
from twentytwentyone.
The contrast ratio between the background colors for the default and the focused state needs to be 3:1.
4.5:1 for the background and text color.
from twentytwentyone.
Yellow:
Foreground:#FFFFFF
Background:#EEEADD
The contrast ratio is: 1,2:1
Orange:
Foreground:#FFFFFF
Background:#E4DAD1
The contrast ratio is: 1,4:1
Red:
Foreground:#FFFFFF
Background:#E4D1D1
The contrast ratio is: 1,5:1
Purple:
Foreground:#FFFFFF
Background:#D1D1E4
The contrast ratio is: 1,5:1
Blue:
Foreground:#FFFFFF
Background:#D1DFE4
The contrast ratio is: 1,4:1
Green:
Foreground:#FFFFFF
Background:#D1E4DD
The contrast ratio is: 1,3:1
For these palette colors, a white background on focus is not enough, there would also need to be a text decoration change.
For links that have underlines, we can remove that underline on focus.
from twentytwentyone.
Related Issues (20)
- Some elements arenβt visible on focus when the body background color is set to white HOT 3
- Spacing issue inside the editor HOT 1
- Impossible to display a button on dark background as the colors are overridden by the theme on hover HOT 2
- Post pagination current item style
- Display captions below featured images HOT 1
- Bug: Cursor is not visible when inserting a new button. HOT 5
- Editor: With Dark Mode enabled, buttons are only white if the selected body background is the default color HOT 1
- Delete sass/02-tools/extends.scss
- Changing image block size does not change caption placement. HOT 2
- The scroll bar of the right sidebar is appearing and dissipating when the height of a browser window between 775-787 px HOT 2
- Task: Report issues with Gutenberg or trac labels upstream HOT 2
- Use :focus-visible instead of :focus to remove undesirable focus styles for mouse clicking HOT 2
- Submenu toggle is too close to the menu item text
- JavaScript error when the responsive menu is toggled
- Buttons placed in a block that has the grey palette color as background are sometimes invisible HOT 4
- Bug: gradient presets shows linear input selections when radial is selected
- The embed figcaption is the wrong text color
- Search block: When the button is inside, the input field has no visible focus indicator
- NEW ISSUES SHOULD BE CREATED ON TRAC
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twentytwentyone.