I am in the process of developing a new starter theme for myself. Within it, I have a number of breakpoints I wish to use throughout the theme. Rather than manage the breakpoints for every single media query, I wanted to set CSS variables as the breakpoint pixel value and call on the variable inside the media query. Below is an example of how (ideally) this would work
:root {
--medium: 1024px;
}
p {
color: black;
}
@media screen and ( min-width: var(--medium) ) {
p {
color: red;
}
}
<p>Text I want to be red in screens larger than 1024px.</p>
This logic sadly does not work in regular CSS/CSS3. Is anyone familiar with a method of creating a single point where I can adjust media query breakpoints for the whole theme without using a preprocessor? Thanks in advance!