Block Themes: How to load and use Style.CSS in the WordPress Full Site Editor (FSE)

Поділитися
Вставка
  • Опубліковано 13 січ 2025

КОМЕНТАРІ • 34

  • @ryanpalmer9467
    @ryanpalmer9467 2 місяці тому +2

    Great tutorial if you want just the goods 4:30 is where it's at

  • @MarkWilliams77
    @MarkWilliams77 13 днів тому

    Thanks mate - been belting my head against a wall for 3 hours over the style.css not applying whilst using a child theme. Like you, I much prefer writing the CSS in a css file rather than that god awful themes.json file. I know it's the future and all that, but you know... old habits die hard :)

  • @kacper.ludwiczak
    @kacper.ludwiczak 9 місяців тому +3

    Hello Jakson, it's me again with more questions... ;)
    1. Can theme.json completely replace the need to use style.css, or do each of these files have their own purpose in Block Themes?
    When creating my first Block Theme, I added in the theme.json file configuration for elements such as site-wide styles or pre-set heading styles. At the same time, I added in the style.css file effects such as smooth scroll and scroll snap. Can all of this be done in one of these files?
    2. Does adding the style.css file to functions.php mean that the style.css takes precedence over theme.json?
    3. The above questions prompted the following: Is using style.css important to learn for a beginner who starts learning Wordpress after the Block Themes revolution, or should I focus solely on mastering theme.json?

    • @wpjakson
      @wpjakson  9 місяців тому +1

      No worries Kacper :)
      1: At this point theme.json cannot replace “all” custom CSS entirely - though you can add your custom CSS to the “additional css” in the editor and it will be exported and and included in theme.json if you use the “Create Block Theme” plugin. At this point all custom stuff that is not directly related to actual Gutenberg Blocks themselves should go in a custom style sheet.
      2: Yes and No - it depends on the specificity of you CSS.
      3: Remember this video tutorial is aimed at helping those that “want” to use style.css, why style.css doesn’t work, and how you can overcome that in block themes. 100% you should defo be using them.json as much as possible and I’ve got some of vids upcoming on that - stay tuned!
      Cheers!

  • @sb_1389
    @sb_1389 3 місяці тому +2

    Between using style.css and going into Styles > Additional CSS in the Block Editor, which is the preferred way to load custom styles? And if it's the "Additional Styles" tab, then is there a way to access that in the file structure directly, rather than a tiny sidebar?

    • @WebMatros
      @WebMatros 3 місяці тому +1

      I don't think so, as that CSS is saved in the database, not as a file.

    • @sb_1389
      @sb_1389 3 місяці тому

      @@WebMatros 😭😔

    • @wpjakson
      @wpjakson  3 місяці тому +1

      Hey S B, yeah, my pref is using style.css - you can add CSS to the theme.json file but its a bit fiddly so (for now) I always use a style.css file on all my client builds

    • @sb_1389
      @sb_1389 3 місяці тому

      @@wpjakson thanks for the response! Is there a difference in how those two areas are handled or loaded?

  • @Hebhansen
    @Hebhansen 2 місяці тому

    Thx - Could you share a link to the snippets?

  • @dp4433
    @dp4433 6 місяців тому +2

    I don't know much about this. I've spent half a day searching, and God knows how many pages I've scrolled through to find a code that works to enqueue child `style.css`. Either they are from before Christ or there's some story where nothing concrete exists. Thank you very much. Liked & subscribed.👍🍻

  • @neilmhart
    @neilmhart 10 місяців тому +1

    Keep the videos coming, Jakson. Maybe I'll ditch my classic theme workflow... one day!

    • @wpjakson
      @wpjakson  10 місяців тому

      haha! We'll get you BlockPressing soon enough Neil!

  • @capitanchorizzo
    @capitanchorizzo 5 місяців тому +1

    Cool, very insightful, specially the child-theme creation part does come in handy just now. Did you explicitly differentiate «jskn_front» and «jksn_add» code?

    • @wpjakson
      @wpjakson  5 місяців тому

      hey @capitanchorizzo , thanks! Can you explain more re "explicitly differentiate «jskn_front» and «jksn_add» code" - not sure I understand?

    • @capitanchorizzo
      @capitanchorizzo 5 місяців тому

      @@wpjakson Sorry for the delay: it's the spelling in the php-functions-code example that you work on. Around 4'50" these spellings are used. I am not PHP-savy so that's why I asked ;-)

  • @visualmodo
    @visualmodo 10 місяців тому +1

    Truly good video!

    • @wpjakson
      @wpjakson  10 місяців тому

      Thanks @visualmodo, glad you liked it!

  • @laughalotandlive
    @laughalotandlive 3 місяці тому +1

    Hey Jakson, I'm just starting my coding journey and I'm sorry to say this isn't working for me. I'm assuming I can't just copy your code whole-sale into my functions.php. If that's right, can you give me a pointer about what I need to do differently on my end? I'm using the Frost theme, maybe that's part of the problem?

    • @wpjakson
      @wpjakson  2 місяці тому

      Hey Michael, the Frost theme is an epic theme! - Yes, you should be able to create a child theme for it using "create block theme" plugin in the same way as I did in this video for the 2024 theme and should work just fine. Fire over your child theme and I'll take a look if you like? Subscribe here and you'll get an email from me and you can reply and attach your theme jakson.co/subscribe/

  • @Ilkestonwebdesign
    @Ilkestonwebdesign 4 місяці тому +1

    I haven't watched this yet but just commenting to say I've bookmarked this and I'm glad that it seems it's possible to wrestle back some of the functionality from classic themes. The way Additional CSS works right now is terrible. Most of my designing takes place by way of the element inspector, as that's where the testing takes place to make sure the right HTML containers are being targeted to wrote the CSS.

    • @wpjakson
      @wpjakson  4 місяці тому

      Thanks for sharing Daren!

  • @attorneyengineer
    @attorneyengineer 8 місяців тому

    Thank you for your lecture. Does your function 'jskn_add_editor_style()' work for only the page editor? In my case, it does not work to the editor in the menu Appearance. It only works in the page editor(the menu Page ->'clicking title' -> and page displayed with editor [css applied]).

    • @wpjakson
      @wpjakson  8 місяців тому

      Hey Hong Sup Lee, not sure I understand completely - what parent theme are you using?

    • @attorneyengineer
      @attorneyengineer 8 місяців тому

      @@wpjakson I am using Twenty Twenty-Four theme.

  • @JimKernix
    @JimKernix 9 місяців тому

    BTW, it's not recommended to do custom styles in styless.css, you should create a new file in the /assets folder.

    • @wpjakson
      @wpjakson  9 місяців тому +2

      Yes, for sure, you can put your styles under assets if you like and is defo the place to organise any separate custom block style CSS.
      For a super basic child theme, as in this vid, my pref is to use the existing style.css to keep things simple.

    • @Ilkestonwebdesign
      @Ilkestonwebdesign 4 місяці тому

      @@wpjakson I'm a little bit confused @wpjakson. Are you saying what you've showed us in the video is incorrect?

  • @kudakwashezvaita1017
    @kudakwashezvaita1017 10 місяців тому +1

    This will stop very soon. AI will take over soon enough.

    • @wpjakson
      @wpjakson  10 місяців тому

      Yes Zed, Ai is already huge in WP - watch out for some content on that here real soon!

    • @puddles5501
      @puddles5501 10 місяців тому

      sure, if you want an incestuously decrepit photocopy of a photocopy, you can automate it.
      i use AI everyday. AI isn't coming for my job, i'm coming for yours.

  • @Floatnride
    @Floatnride Місяць тому

    so assume we can bake this into our child themes so it's ready to go each time.