• I want H2 headings look different in posts as opposed to on pages. For instance, so that H2 are 1.2em in font-size on posts and 1.8em on pages.

    With classic CSS this isn’t hard, as I can target the class for the page or post and then h2.

    But with theme.json, what’s the best way to add this? Or should I add it in the template file?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi
    Great question. In theme.json, we can not add different default styles for different types of pages, only one default style.

    You could change it in the templates or use custom CSS, either in theme.json or if you have enqueued a stylesheet.

    Thread Starter audunmb

    (@audunmb)

    You could change it in the templates or use custom CSS, either in theme.json or if you have enqueued a stylesheet.

    How can I do that? Using page templates would be the best option for my use case, but I can’t find any documentation on how to add CSS to templates. Even your rather informative website fullsiteediting.com doesn’t have anything on that.

    Simple adding some rules in a style.css would of course work, but that would be a workaround.

    Thread Starter audunmb

    (@audunmb)

    Created a GitHub-issue since I can’t find a solution, maybe someone would come up with something there.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Different headings for posts and pages in FSE theme’ is closed to new replies.