• Resolved Gojero

    (@gojero)


    Hi,
    I tried something else on my local website Mamp environment.
    I made a child template with the plugin Create Block Theme. Another feature is that you can add fonts!! I always have liked 2014’s theme Lato font.
    Did make a child the ‘old fashioned way’ It worked…but yeah, do it right if possible aye?

    I have a question what is more preffered. Change as much as possible styling in the json theme file? or is the style.css also ok. I can imagine that if you stick with the json file as much as possible that it would be positive for the loading times in the browser?

    This works:

    /* --- URL without underline --- */
    	a {
    		text-decoration: none;
    		}
    	
    /* --- Navigation block without underline --- 
    	a:where(:not(.wp-block-navigation)) {
    		text-decoration: none !important;
    		}
    

    Also works is to set all text-decoration to ‘none’ in the Json file.
    But it more easier to change this in the style.css, just because it is familier to us. On the other hand it is fun to do something different because it is new and the outcome is/can be more positive in the long-term.

    Jeroen

    • This topic was modified 1 year, 11 months ago by Gojero.
    • This topic was modified 1 year, 11 months ago by Gojero.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Does your childs style.css work without a functions.php?

    Related to this, I still want to know what the “proper” way is to add a custom style.css?

    Note: What I learned is that a block theme child does not need a function.php anymore. But without it the style.css of my child gets ignored. The suggested way of this forums
    sticky topic only mentions to add css code at the “Additional CSS” panel, accessible via …/wp-admin/customize.php
    But the place and layout of this panel is horrible for coding…

    Thread Starter Gojero

    (@gojero)

    Yes I can relate to you, that was what have I read too. It is very confusing!
    I did some testing and found out that it is necassary to enqueue the css style in a function.php. Than the style.css works properly.

    Moderator Kathryn Presner

    (@zoonini)

    Hi @gojero – glad you’re enjoying the different capabilities of Create Block Theme, like adding fonts!

    Block themes are indeed meant to be designed in the Site Editor, rather than through custom CSS. So if you want to have a separate stylesheet in a child theme of a block theme, you do need to manually enqueue it, and it’s not something the Create Block Theme does automatically.

    I’ll mark this thread as resolved since it looks like you’ve gotten everything sorted, but feel free to start a new one if you have other questions.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Child theme – preffering style changes – css vs json’ is closed to new replies.