-
-
Notifications
You must be signed in to change notification settings - Fork 594
[6.x] Themes can now be .css files in resources/themes #12947
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
base: master
Are you sure you want to change the base?
Conversation
|
I think the only real objection I have is that the location |
That's a good point. We don't really have another place where it makes sense though. I guess it could just be |
|
|
Yup true. I'm assuming this would replace that. |
That would be the source for a css file. The theme would be a compiled file. Maybe the solution will become more obvious once we have more of the theme builder ui/workflow. |
|
The CSS override workflow makes perfect sense to me. It's neat. RE naming, I do agree with Jason's point. What about something like |
|
Would the CSS file replace the need for the |
|
I guess And yeah this would/could replace the theme array, though you could still use that to set a default, or use the |
# Conflicts: # resources/views/partials/head.blade.php # src/CP/Color.php
This reverts commit df72a84.
PROOF OF CONCEPT — INTERNAL DISCUSSION NEEDED
You can now set your theme config setting as a string, and if that matches a corresponding .css file
resources/themes/it'll load it instead of the config.And inside that css file you could have something like this (please don't use this actual config – it's butt soup)
Note
Adds support for
resources/themes/*.csstheme files and conditionally injects them inhead.blade.php, falling back to generated CSS variables.src/CP/Color.php:theme()to accept a string and resolveresources/themes/{name}.css(updated return typearray|string).isUsingThemeFile()andthemeCss()for detection and retrieval of theme CSS.Statamic\Facades\Filefor file checks/reads.resources/views/partials/head.blade.php::rootwithcssVariables().Written by Cursor Bugbot for commit dde95f0. This will update automatically on new commits. Configure here.