Skip to content

Can't override external CSS without !important #331

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

Closed
rmarren1 opened this issue Aug 14, 2018 · 6 comments
Closed

Can't override external CSS without !important #331

rmarren1 opened this issue Aug 14, 2018 · 6 comments
Assignees

Comments

@rmarren1
Copy link
Contributor

rmarren1 commented Aug 14, 2018

Not really a bug, just something I noticed that we should be aware of.

In the new assets directory approach to including CSS, external stylesheets always appear beneath local stylesheets.

There doesn't seem to be a way to switch this (at least that I'm aware of), so a user can't override CSS from external libraries without !important since external scripts will always be imported last and thus take precedence. I think this is a very common use case (e.g. import bootstrap, then add your own CSS to customize a small part of bootstrap) and users shouldn't have to manually add !important to all their stylesheets or change the specificity of selectors to get it to work.

@rmarren1
Copy link
Contributor Author

@T4rk1n

@T4rk1n T4rk1n self-assigned this Aug 14, 2018
@T4rk1n
Copy link
Contributor

T4rk1n commented Aug 14, 2018

I'll change the assets to go after external.

@chriddyp
Copy link
Member

chriddyp commented Aug 14, 2018

I'll change the assets to go after external.

Yeah, that seems like it would be the right default behaviour.

@chriddyp
Copy link
Member

And if the user really needs to customize it, then they can override the index

@rmarren1
Copy link
Contributor Author

Is that possible right now? I tried but it looks like external and local css are imported as one chunk without an option to order them:

index = self.interpolate_index(

@T4rk1n
Copy link
Contributor

T4rk1n commented Aug 14, 2018

No, it's not possible to reorder right now, I want to change the generate_html methods to be separate from the resources collection and give raw resources list to interpolate_index instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants