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

Automatically enqueue style.css when creating a blank theme #334

Open
annezazu opened this issue Apr 22, 2023 · 7 comments
Open

Automatically enqueue style.css when creating a blank theme #334

annezazu opened this issue Apr 22, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@annezazu
Copy link

Pulling in feedback from the FSE Outreach program's Build A Block Theme exploration:

There is an empty style sheet added when a blank theme is created with CBT plugin. But adding CSS to it doesn’t work until a functions.php is added to enqueue it. I think that style.css should automatically be enqueued or that a functions.php with the enqueue should be included. I am trying to use only the editor, but think that if the stylesheet is there, it should be usable.

@carolinan
Copy link

How can we explain to users that the Stylesheet is used because it is required to provide WordPress with information about the theme, like the theme name and version, not to add CSS?
Add a comment to the file?

@annezazu
Copy link
Author

Ohh I see. Thanks for clarifying -- limits of my lack of knowledge with themes. I think a comment is a great idea and approach.

@carolinan
Copy link

carolinan commented Apr 23, 2023

In a way I agree that "if it is there it should work", but in this case it can't be removed even if it is otherwise empty.

I also think that if the person knows that the theme needs a functions.php and knows the css file needs to be enqueud, its not too difficult for them to add it.

So is it more beneficial to:

  • enqueu it "in case anyone wants to use it"
    Or,
  • not include a file that is not used by default (functions.php), and not enqueu a file that is not used by default (style.css)

@kathrynwp
Copy link

This came up again with a user in the forum:
https://wordpress.org/support/topic/create-a-child-theme-for-twenty-twenty-three/

So is it more beneficial to:

- enqueu it "in case anyone wants to use it"
Or,
  • not include a file that is not used by default (functions.php), and not enqueu a file that is not used by default (style.css)

I agree very much with @carolinan that it would be much less confusing for users to go with either of these two options.

@askdesign
Copy link
Member

I would prefer to use a style.css file than the Additional CSS area in the FSE block editor. The Additional CSS UI and accessibility is dreadful. I find it much simpler to use a style.css file, but to have to enqueue it yourself? Led me down a rabbit hole that I'm finally climbing out of.

@tomfinitely
Copy link

Just ran into this issue and it definitely needs some love.

@cre8tivediva
Copy link

I agree. Style.css file for me as well. Definitely should be enqueued already, even if it's not used. It will be there for those who want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

7 participants