Responsive Design with Block Themes
-
I’m learning about block themes for the first time and I’m not clear on how responsive layouts are achieved.
For example, let’s say I want a paragraph to use red font with screen width is less than or equal to 700px, and blue font all other times. Using plain HTML CSS, it would look like this:<style> p { color: blue; } @media (max-width: 700px) {p { color: red; }} </style> <p>Hello World</p>
I’ve been trying to read up on theme.json, but it’s not clear to me how block themes would achieve the behavior I mentioned above. Can someone point me in the right direction?
Or another example, I need to achieve:<style> ul { display: grid; grid-template: ...etc... } @media (max-width: 700px) { ul { display: flex; ...flex-options...} } </style> <ul> <li>Item</li> <li>Item</li> <li>Item</li> </ul>
Basically depending on what the screen width is, I want to completely change the way elements are laid out. How are these types of rules defined in a block theme?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Responsive Design with Block Themes’ is closed to new replies.