For years, making a WordPress website look great on mobile meant writing custom CSS media queries or relying on a page builder. That changed with WordPress 7.1. WordPress responsive styling lets you set different styles for desktop, tablet and mobile directly in the block editor, and new interactive states let you style hover, focus and active effects on buttons, all without touching a stylesheet.
In this step-by-step guide I show you how these tools work, walk through real examples, share accessibility tips, and explain what theme and block developers should know, including the improvements coming in WordPress 7.2.
What Is Responsive Styling in WordPress?
Responsive styling means a block can look different depending on the screen size. A large hero heading might be 64 pixels on desktop but 36 pixels on a phone. A section with generous padding on a wide screen might need tighter spacing on mobile so the content does not feel squeezed.
Before WordPress 7.1, the editor could preview different devices, but any style you changed applied everywhere. Now you can choose to apply a change to a single viewport only. WordPress generates the necessary CSS for you behind the scenes.
What You Need
- WordPress 7.1 or newer. Check under Dashboard > Updates.
- The block editor. Responsive styles work on individual blocks and in Global Styles in the Site Editor.
- A theme that supports the relevant design tools. Most modern block themes do. Theme authors can also customize the breakpoints used.
How to Style a Single Block for Mobile
Let’s start with the most common task: making a heading smaller on phones.
- Open the page or post in the block editor and select the heading block.
- Open the viewport menu in the editor toolbar, which lists Desktop, Tablet and Mobile.
- Switch to Mobile and turn on the Responsive styles option so that your next change applies to this viewport only.
- In the block settings sidebar, open Typography and choose a smaller font size.
- Switch back to Desktop to confirm the original size is unchanged, then save.
That is it. No child theme, no Additional CSS panel, no media queries. The same approach works for spacing, dimensions and other supported style settings.
How to Apply Responsive Styles Site-Wide
If you want every instance of a block to behave the same way, use Global Styles instead of editing each block individually:
- Go to Appearance > Editor and open Styles.
- Choose Blocks and select the block type, for example Heading or Group.
- Switch the viewport to Tablet or Mobile with responsive styles enabled.
- Adjust typography, spacing or dimensions, then save.
Global responsive styles are perfect for consistent rules, such as reducing all section padding on mobile, while per-block styles are great for one-off adjustments.
How to Add Hover, Focus and Active States to Buttons
Interactive state styling is the second big design feature in WordPress 7.1. It lets you define how buttons look when visitors hover over them, focus them with a keyboard, or click them.
- Select a Button block, or open the Button block in Global Styles to style all buttons.
- Choose the state you want to style: Hover, Focus or Active.
- Set the background color, text color or other supported styles for that state.
- Preview the front end and hover, tab and click to check each state.
In WordPress 7.1, interactive states are available for buttons. The WordPress 7.2 roadmap includes custom block states, which would extend this idea further.
Practical Examples
Example 1: A hero section that fits on phones
Set the hero heading to a large size on desktop, then reduce it for mobile. Reduce the Cover or Group block’s top and bottom padding on mobile too. The result is a hero that feels bold on a laptop and still shows the call-to-action button without scrolling on a phone.
Example 2: Comfortable reading on small screens
Use Global Styles to slightly reduce paragraph size and line height on mobile, and to tighten the gap between blocks. Long articles become easier to read on phones without changing the desktop design.
Example 3: Clear button feedback
Give your primary buttons a slightly darker background on hover and a strong, visible outline on focus. Visitors get clear feedback, and keyboard users always know where they are on the page.
Example 4: Preventing collapsing columns
WordPress 7.1 also added a minimum width control to the dimension settings. Combine it with responsive styles to stop cards or columns from becoming too narrow on tablets.
Accessibility Tips for Interactive States
- Always style focus: keyboard users rely on a visible focus indicator. Never make the focus state invisible.
- Keep contrast high: check that text remains readable in every state. Aim for at least WCAG AA contrast.
- Don’t rely on hover alone: touch screens do not have hover, so important information should never appear only on hover.
- Keep text sizes readable on mobile: shrinking text too much hurts readability. Body text around 16 pixels is a good baseline.
Why This Is Better Than Custom CSS for Most Sites
Custom CSS still has its place, but using built-in responsive styling has real advantages:
- Visible in the editor: what you see while editing matches the front end.
- Easy for clients: non-technical editors can make adjustments without risk of breaking a stylesheet.
- Theme-aware: styles use the theme’s presets and breakpoints, which keeps the design consistent.
- Less to maintain: fewer custom CSS rules mean fewer surprises when you switch themes or update.
Keep custom CSS for advanced effects, animations or very specific layouts that the design tools do not yet cover.
How to Migrate Existing Custom CSS
- Open your Additional CSS or child theme stylesheet and list the media query rules.
- Identify rules that only change font sizes, spacing or button colors. These are good candidates to move.
- Recreate them with responsive styles or interactive states, starting with Global Styles.
- Remove the old CSS rules one at a time and check each page on a staging site.
- Clear your cache and test on real phones and tablets, not only the editor preview.
For Theme Developers: Breakpoints in theme.json
WordPress 7.1 introduced viewport breakpoint customization, so themes can define the breakpoints that responsive controls snap to in theme.json, rather than relying on fixed values from core. This keeps the editor aligned with your theme’s design system. Check the official WordPress 7.1 Field Guide and theme handbook for the exact settings structure before shipping.
For Block Developers: What Changes in WordPress 7.2
In WordPress 7.1, only core blocks could build their own per-breakpoint controls because the helpers were private. Gutenberg 24.1 made the viewport state helpers public, so custom blocks can offer responsive settings too. @wordpress/block-editor now exports getStyleForState() and setStyleForState():
const state = { viewport: '@mobile' };
const stateStyle = getStyleForState( attributes.style, state ) || {};
setAttributes( {
style: setStyleForState( attributes.style, state, {
...stateStyle,
dimensions: { ...stateStyle.dimensions, minHeight: '50vh' },
} ),
} );
Position can also vary by viewport in the 7.2 cycle, which means a header can be sticky on mobile only. The Gallery block gains per-viewport columns, crop and aspect ratio settings as well. Read more in my overview of WordPress 7.2 new features.
Responsive Design and Performance
Responsive design is about more than appearance. Mobile visitors often make up the majority of traffic, and search engines evaluate the mobile experience. Lighter layouts, readable text and well-sized images all contribute to better engagement. Pair responsive styles with optimized images, which WordPress now handles more efficiently through client-side media processing, and good caching.
A Simple Responsive Design Workflow
Having the tools is one thing; using them efficiently is another. This is the workflow I follow when building or refreshing a WordPress site with responsive styles:
- Design desktop first in Global Styles. Set typography, colors and spacing for the main layout.
- Add global mobile rules. Reduce heading sizes and section padding for mobile once, at the Global Styles level.
- Check tablet separately. Tablets often need in-between values, especially for multi-column layouts.
- Style button states globally. Define hover, focus and active styles for all buttons so they behave consistently.
- Use per-block styles only for exceptions. A special hero or landing section can get its own responsive tweaks.
- Test on real devices before handing over the site.
Working from global to specific keeps your design consistent and avoids dozens of individual overrides that are hard to maintain later.
Common Mistakes to Avoid
- Forgetting to enable responsive styles: if the option is off, your change applies to every device. Always check the desktop view after editing mobile.
- Too many per-block overrides: they make future redesigns slower. Prefer Global Styles where possible.
- Mixing custom CSS and responsive styles for the same property: two sources of truth can conflict. Choose one approach per property.
- Making mobile text too small: readability matters more than fitting everything on one screen.
- Ignoring focus styles: a beautiful hover effect is not enough; keyboard users need a clear focus state too.
How to Test Your Responsive Design
The editor preview is a good start, but real-world testing catches issues it can miss:
- Browser developer tools: the device toolbar in Chrome, Firefox or Safari lets you test many screen sizes quickly.
- Real phones and tablets: nothing replaces holding the device, especially for touch targets and text size.
- Keyboard navigation: press Tab through the page to check that focus states are visible on every button and link.
- Lighthouse or PageSpeed Insights: check mobile performance and accessibility scores after your changes.
Handing Over Sites to Clients
Responsive styling is a big win for client handovers. Instead of explaining that mobile changes require a developer, you can show clients how to switch the viewport and adjust a heading themselves. A short screen recording covering the viewport menu, the Responsive styles option and Global Styles is often enough. Clients feel more in control, and you receive fewer small support requests.
To keep designs consistent, agree on a few simple rules with the client, such as using Global Styles for site-wide changes and limiting per-block overrides to special pages. Lock important template parts where appropriate so key layout areas are not changed by accident.
Where Responsive Styling Is Heading
The direction is clear: more design decisions are moving from code into the editor. WordPress 7.2 extends responsive controls to custom blocks, lets position vary by viewport, brings per-device settings to galleries, and plans custom block states and form element styling in Global Styles. Each step reduces the amount of custom CSS a typical site needs, while still leaving room for developers to go further when a project calls for it.
Frequently Asked Questions
Which WordPress version added responsive styling?
WordPress 7.1, released on August 19, 2026, added responsive styling per device and interactive states for buttons.
Do I still need a page builder for mobile layouts?
For many sites, no. The block editor now covers common responsive needs such as font sizes, spacing and button states. Page builders remain an option if you need features beyond core.
Can I add hover effects to blocks other than buttons?
In WordPress 7.1, interactive states are available for buttons. Custom block states are on the WordPress 7.2 roadmap.
Will responsive styles work with my classic theme?
These tools are designed for the block editor and block themes. Classic themes may support some block styles, but full functionality is best experienced with a modern block theme.
Conclusion
WordPress responsive styling and interactive states turn two of the most common custom CSS tasks into simple editor settings. You can tailor layouts for every device, give buttons clear and accessible feedback, and hand over sites that clients can confidently edit themselves. Try it on a staging site, move your simplest media queries into Global Styles, and enjoy a cleaner, easier-to-maintain design.
Sources: the WordPress 7.1 release page and the WordPress Developer Blog.

Leave a Reply