-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
[1.x] Theme Extender to Allow overriding LESS
files
#3008
Conversation
file sources are the base files that import more less files, for example: `forum.less`, `admin.less`, `variables.less`
Before getting into the code, what are some use cases for this? Isn't overriding already possible by just specifying new less after the first set |
Yes, but I believe that results in duplicated styles. If we take // styles.less
a {
color: red;
}
// theme.less
a {
color: blue;
} ...we end up with both separate styles in the compiled CSS one after the other. Less doesn't merge them into one selector and remove the unused property-value pair. |
I'm glad you asked, made me think about this some more, and here are the pros and cons of having this. Pros
Cons
|
I haven't had a chance to review the code yet, but I agree with the idea in general. I have found theming Flarum to be a royal pain because of trying to override pre-existing CSS and other logic as it stands currently. Letting communities start with a blank slate if that's what they want is the way to go. |
This one sold me. I haven't really done theming work, and assumed that most of it is tweaks as opposed to 0-1 work. Will take a look at the code next week when I have access to my laptop again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not had a chance to test locally, so someone will need to do that.
|
||
$response = $this->send($this->request('GET', '/')); | ||
|
||
$this->assertEquals(500, $response->getStatusCode()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we be a bit more specific as to the expected error message? I'm wary of expecting 500s as that can sometimes provide very little useful debugging info (or could be triggered when other, unrelated stuff is broken).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be better to drop this test
Fixes #2817
Changes proposed in this pull request:
This PR introduces the ability to just override a
LESS
file's contents through an extender.This is mainly useful for theme development, as there are times in extensively customized themes where overriding the actual file makes a huge difference vs overriding CSS styles which can turn into a maintenance hell real fast.
Reviewers should focus on:
Frontend
.overrideFile
. I'm personally okay with having this separation, I believe extension developers should understand the difference.Confirmed
composer test
).