Update font weight options

This commit is contained in:
Tetrakern 2024-01-04 05:51:34 +01:00
parent b9ab66e5c6
commit 5c55567c73
6 changed files with 16 additions and 8 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2546,7 +2546,7 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
array(
'capability' => 'manage_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'default'
'default' => 'adjusted'
)
);
@ -2559,7 +2559,7 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
'label' => __( 'Dark Mode Font Weight', 'fictioneer' ),
'description' => __( 'Fonts are rendered thinner in dark mode to offset text bleeding; you can turn that off.', 'fictioneer' ),
'choices' => array(
'default' => _x( 'Adjusted', 'Customizer dark mode font weight option.', 'fictioneer' ),
'adjusted' => _x( 'Adjusted', 'Customizer dark mode font weight option.', 'fictioneer' ),
'normal' => _x( 'Normal', 'Customizer dark mode font weight option.', 'fictioneer' )
),
)

View File

@ -538,16 +538,20 @@ if ( ! function_exists( 'fictioneer_add_customized_layout_css' ) ) {
}";
}
if ( get_theme_mod( 'dark_mode_font_weight', 'default' ) === 'normal' ) {
if ( get_theme_mod( 'dark_mode_font_weight', 'adjusted' ) === 'normal' ) {
$layout_css .= ":root[data-font-weight=default]:is(html) {
--font-smoothing-webkit: subpixel-antialiased;
--font-smoothing-moz: auto;
--font-weight-normal: 400;
--font-weight-semi-strong: 600;
--font-weight-strong: 600;
--font-weight-medium: 500;
--font-weight-heading: 600;
--font-weight-heading: 700;
--font-weight-badge: 600;
--font-weight-post-meta: 400;
--font-weight-ribbon: 700;
--font-weight-navigation: 400;
--font-letter-spacing-base: 0em;
}";
}

View File

@ -529,14 +529,18 @@
// =============================================================================
:root[data-font-weight=normal]:is(html) {
--font-smoothing-webkit: subpixel-antialiased;
--font-smoothing-moz: auto;
--font-weight-normal: 400;
--font-weight-semi-strong: 600;
--font-weight-strong: 600;
--font-weight-medium: 500;
--font-weight-heading: 600;
--font-weight-heading: 700;
--font-weight-badge: 600;
--font-weight-post-meta: 400;
--font-weight-ribbon: 700;
--font-weight-navigation: 400;
--font-letter-spacing-base: 0em; // Unit is required!
}
:root[data-font-weight=thinner]:is(html) {