Thursday, October 6, 2022
HomeWordPress Developmentcss - Greatest observe for customized main coloration of pages

css – Greatest observe for customized main coloration of pages


My web site ought to have 6 coloration. A “maincolor” might be chosen for every web page.

The colour is ready by an acf contained in the physique class (It is a choose discipline on pages and it return the worth.)

<physique <?php body_class('maincolor-' . get_field('maincolor')); ?>>

Truly, I might now create all 6 coloration schemes in scss like:

.maincolor-red {
    h1 { coloration: pink;}
    a { coloration: pink;}
    .card { background-color: pink;}
}

.maincolor-blue {
    h1 { coloration: blue;}
    a { coloration: blue;}
    .card { background-color: blue;}
}

and so forth …

However I’ve numerous ACF blocks and different parts that needs to be affected by the maincolor. And I can not think about that is a wise approach to do it. There are actually higher strategies with variables or one thing that I can not consider or are conscious of.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments