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

[Theme extender] Ability to override core LESS files #2817

Closed
SychO9 opened this issue Apr 29, 2021 · 2 comments · Fixed by #3008
Closed

[Theme extender] Ability to override core LESS files #2817

SychO9 opened this issue Apr 29, 2021 · 2 comments · Fixed by #3008
Assignees
Milestone

Comments

@SychO9
Copy link
Member

SychO9 commented Apr 29, 2021

When designing a flarum theme, any Less/CSS code you write needs to override any default styles present in core, that means you constantly have to over-specify elements, using !important also becomes necessary at times. An optimal solution would be to be able to tell the software: here is a (for example) DiscussionListItem.less file that overrides the default, the software would then not load the default and instead load the custom one.

There might be something that allows us to hook into the import process of Less files, an import_callback option, we'd have to pass that to the Less_Parser object instantiation here.

This should be a method within a Theme extender.

@SychO9 SychO9 added this to the 2.0 milestone Apr 29, 2021
@iamdarkle
Copy link
Member

@SychO9 I know it's a bit off topic, but until this is implemented is there a way to overwrite without constantly abusing !important?

@SychO9
Copy link
Member Author

SychO9 commented Jul 16, 2021

Well, you either overspecify, or use the important rule, or both, that's really all you can do.

@SychO9 SychO9 self-assigned this Aug 3, 2021
@SychO9 SychO9 changed the title [Theme extender] Ability to override core Less files [Theme extender] Ability to override core LESS files Aug 10, 2021
@SychO9 SychO9 modified the milestones: 2.0, 1.1 Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants