-
Notifications
You must be signed in to change notification settings - Fork 212
Extract vendored css from style.css into a separate file vendored.css… #993
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
Conversation
I'll look into it. |
I think you just need to add |
@jyn514 I considered that but my counter-thought was that an actual docs page wouldn't use pure-css or fontawesome. Well, I was/am wrong :) |
Yeah, docs.rs adds the header bar at the top which uses both. |
Also I am getting an error when I am trying to run this locally:
Any idea? |
Run |
Oh hold on you already have the server running, run |
@jyn514 Ah let me try that. I am suspicious that adding |
|
Oh I see, you mean in https://github.com/rust-lang/docs.rs/blob/master/src/utils/html.rs#L26 it gets appended instead of prepended. Well, we could probably change that to |
@jyn514 Okay, I am currently running |
If you push your changes I could run a build locally so it doesn't take as long (I have all the stuff cached already). |
Opened #995 to make this less painful |
…ore the first rustdoc stylesheet
let (head_selector, body_selector, first_stylesheet_selector) = ( | ||
"head".parse().unwrap(), | ||
"body".parse().unwrap(), | ||
"link[type='text/css'][href*='normalize']".parse().unwrap(), |
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 consider this a hack because we are assuming that the first stylesheet included by rustdoc is normalize.css which might not be the case in the future (But I gotta say, having css style selectors is pretty nice :)).
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.
This doesn't depend on it being first, though, does it? The reason it needs to come before normalize
is because pure-css bundles its own whole separate copy, but I don't think pure-css duplicates any other of the rustdoc styles.
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.
This doesn't depend on it being first, though, does it?
Well, it just needs to be positioned before rustdoc.css
. By just inserting the vendored.css link before or after all head elements doesn't seem to be a good idea either.
Could you also add a test that the code has the right font (not |
@jyn514 Uhm, how does checking the evaluated font exactly work. I mean afaiu kuchiki will simply parse the html but won't evaluate the css? |
Hmm that's a good question .. I'm not sure :/ let me read through the docs. |
Yeah I don't see a way to do this without adding full UI tests unfortunately :/ let's merge the fix for now and we can try to add the test later. |
Thanks for the PR! |
… (Fixes #992)
Closes #992.
I haven't actually tested this myself yet.