JavaScript for WordPress Forums Gutenberg Development import './style.scss';

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #46912

    I may have missed it in my watch through the course, but what does importing style.scss provide differently than enqueueing the stylesheets for the block?

    I was reading through the index.js for sample plugins and this was the only thing I didn’t feel like I could explain.

    Thanks for the great course.

    Zac Gordon

    Hey Jason!

    Importing the css in this way is simply one of the styling patterns for React. Gutenberg Core uses it so for these reasons I’m using it here. In these examples, webpack is processing and spitting out the final css that we end up enqueuing.

    You can also just have a single css file (or other architecture) and enqueue that. I think either way is probable fine and not a major benefit one way or the other if you don’t have a preference (or do :))

    Hope that helps! Good question 🙂

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.