While you can not use CSS to detect Custom font sizes they can be disabled using this code:
add_theme_support( 'disable-custom-font-sizes' );
Then, to have more control over how the look of font sizes are, we can use:
add_theme_support( 'editor-font-sizes', array(
array(
'name' => 'Small',
'slug' => 'small',
'size' => '14px'
),
array(
'name' => 'Normal',
'slug' => 'normal',
'size' => '18px'
),
// etc.
) );
Then, where size
is small
here, we make a CSS rule like:
.has-medium-font-size {
font-size: 14px;
}
Using the classes we can make logical breakpoints for the sizes.
Might help someone with a similar issue…
Related Posts:
- How to define and link full path to css located at a random folder on header.php
- How to add CSS class to custom logo?
- How to add custom css file in theme?
- How important is it to enqueue a theme’s stylesheet?
- CSS not updating in browser when I change it
- Solutions for generating dynamic javascript / CSS
- Do I actually need to link my theme’s style.css in the theme files
- Enqueue a stylesheet for login page and make it appear in head element
- CSS classes for theme
- Generating CSS Files Dynamically Using PHP Scripts?
- Enqueue Stylesheets After Theme’s “rtl.css”
- Are the WordPress Core CSS styles really all nessesary?
- Understanding wp_add_inline_style
- Any alternate TinyMCE4 themes / subthemes?
- Splitting WordPress theme CSS into multiple files, good or bad?
- Hide a div that is part of all pages on one specific page
- Why I can’t add a CSS style in this WordPress theme?
- Can’t get staging site to display same way as live site. Completely stumped
- How to make a theme with more than one CSS file?
- Editing the custom background CSS
- How to edit an existing WordPress theme? [closed]
- Suggestions for creative use of post format feature, or themes that use them well
- Add class to before_widget for all widgets with a dropdown and a counter
- Why max-width:97.5% on content images?
- add generated stylesheet from parent theme after child-themes style.css
- Add a preview to a WordPress Control Panel
- use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
- why does twenty eleven theme mix up the css measurement units?
- Setting up partial Right-to-Left admin interface
- Adding inline styles from a widget
- Can’t edit style.css in subdirectory of my theme?
- Adding dashicon fonts to the admin of pre 3.8 installs
- How to Handle CSS for Multiple Header header.php Files?
- CSS in child theme not overriding the parent theme [closed]
- How to add (css) classes to only one wp_nav_menu()?
- Adding dashicon fonts to the admin of pre 3.8 installs
- Move my theme style.css into a folder
- Convert a static website to a WordPress theme and import all existing content
- How to keep theme layout the same when admin gray bar is present?
- Enqueued Stylesheets Effecting Admin Styles
- Custom CSS In Uploads Folder
- There’s an image named g.gif somewhere in my WordPress site
- wp_head() not inserting the default stylesheet style.css
- How to highlight the current page in the nav menu?
- Writing Clean WooCommerce Styles
- First completely customized theme, where should I start?
- Root Sage theme styles are not working!
- De-registering parent style sheet css recommended?
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- Alterntives to BEM syntax that comply with WordPress coding standards? [closed]
- Modify the Additional CSS section (adding a disclaimer)
- Sub folder CSS that’s read by Admin panel
- WordPress 5.8 update problem custom theme styles are overridden by core styles common.min.css
- WordPress default theme css units
- CSS won’t style output of wp_nav_menu() correctly
- Where is definied the theme location for the main menu in a WordPress template?
- Why nav_menu_css_class doesn’t work with apply_filters?
- How do I change the color of individual page titles in WordPress?
- 3 Level Menu Navigation (3rd Level not displaying)
- Default customizer colors aren’t displayed outside of the preview
- Find the source file causing a Mixed Content warning
- How to reduce the vertical space above and below a ul list uniformly with one command?
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- How can I fix my theme header for my CSS stylesheet?
- How to display only the first two elements from ten same elements
- WordPress doesn’t load css, image and js files after moving local installation folder
- How to generate a rtl.css file for themes?
- Load multiple css simultaneously using functions.php
- Necessary css classes to be included in theme stylesheet
- overlay post title over post’s featured image
- Change site title color on individual pages
- Images use & location, on new wordpress theme
- Mobile view logo background colour in wordpress
- How to fix an issue with customizer live preview?
- WordPress Customization API overwrite LESS variable
- Custom CSS no getting applied
- How can I fix the even/odd child classes comments so that the comments are unaffected by the top-level even/odd?
- editor style css and page template with and without sidebar
- Enqueue Stylesheets After Theme’s “rtl.css”
- WordPress 3.5 + Foundation 5 not working on IE9
- Why the slideshow is not shown in my theme?
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- adding navigation to genesis themes
- Alternating CSS classes for dynamic content [closed]
- Custom link color or stylesheets
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- Header is not showing full width
- Setting different CSS for all pages except home.php
- How do I middle-align my header menu items in WordPress [closed]
- How to resize video lightbox popup in wordpress? [closed]
- How can I get rid of the distance when I’m using list-style-type: none? [closed]
- How to highlight current menu bar base on the URL?
- What is The Best Way to Make Parallax header effect for wordpress theme ?? pure CSS or using JavaScript? [closed]
- How customizable is a self-hosted WordPress blog compared to a Blogger blog?
- HTML to WORDPRESS [closed]
- Align images to the left of the content
- Image and font support missing in editor when deploying theme remotely
- WordPress search field won’t get wider
- WordPress 6.4.2 – can’t load editor style css using ‘after_setup_theme’ or ‘admin_init’ actions
- Twenty Twenty-Four Theme, where to put the personalized CSS style rules?