Directory

Create block: add variation for CSS · Issue #52181 · WordPress/gutenberg · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create block: add variation for CSS #52181

Open
benoitchantre opened this issue Jun 30, 2023 · 2 comments
Open

Create block: add variation for CSS #52181

benoitchantre opened this issue Jun 30, 2023 · 2 comments
Labels
[Package] Create Block /packages/create-block [Type] Enhancement A suggestion for improvement.

Comments

@benoitchantre
Copy link
Contributor

What problem does this address?

The create-block package allows us to scaffold blocks, but with a preference for SCSS.

When developers prefer to use CSS, they either have to use the default template and rename the files or to create and maintain their template.

What is your proposed solution?

Would it be possible to add a variation to use CSS instead of SCSS?

@ryanwelcher ryanwelcher added the [Package] Create Block /packages/create-block label Jun 30, 2023
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Jul 18, 2023
@t-hamano
Copy link
Contributor

Hi @benoitchantre,

Even if the extension is scss, the CSS notation can still be used. Therefore, you can simply write CSS in src/style.scss, for example, without changing the directory structure or changing the extension.

Alternatively, if you do not use ES6 notation in your JavaScript and do not need to compile, you can use the ES5 template, which will generate the CSS files.

npx @wordpress/create-block gutenpride -t es5

Would this be helpful?

@benoitchantre
Copy link
Contributor Author

Hi @t-hamano,

Thank you for your helpful reply. I have started my own template as I think I’ll personalize it a bit more.

If I need to come back, I’ll rename the files either manually or using a small bash script. Writing CSS in SCSS is ok, but doesn’t really enforce a standard if you want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Create Block /packages/create-block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants