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

Styles in the head are not loaded #8

Closed
pedrokost opened this issue Feb 9, 2014 · 7 comments
Closed

Styles in the head are not loaded #8

pedrokost opened this issue Feb 9, 2014 · 7 comments

Comments

@pedrokost
Copy link

The stylesheets, when included in the <head> are not loaded when the page is displayed. I had to include them in the <body> for them to be loaded.

@Pezmc
Copy link

Pezmc commented Feb 9, 2014

By the looks of it the code assumes the <head> (apart from the title) is the same and doesn't check for changes in CSS or scripts.

It just takes anything within the <body> of the new page and swaps it with the<body> of the current page.

Perhaps it could assess if there are changes in style sheets and if necessary preload & swap them in.

@dieulot
Copy link
Owner

dieulot commented Feb 9, 2014

InstantClick only changes the <body>.

I realize now that the website doesn’t talk about that (it only says it’s the same mechanism as pjax), I’ll change that soon. Sorry!

@dieulot dieulot closed this as completed Feb 9, 2014
@pedrokost
Copy link
Author

I see. Turbolinks has a data-turbolinks-track attribute that can be added to scripts in the head, which causes them to be reloaded. It would be a welcome addition to InstantClick.

@dieulot
Copy link
Owner

dieulot commented Feb 9, 2014

Yup, tracking asset changes should come.

On Sunday, February 9, 2014, Pedro Kostelec notifications@github.com
wrote:

I see. Turbolinks has a data-turbolinks-trackhttps://github.com/rails/turbolinks/pull/133attribute that can be added to scripts in the
head, which causes them to be reloaded. It would be a welcome addition to
InstantClick.

Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-34573220
.

@IonicaBizau
Copy link

@dieulot Wouldn't be useful an option to change the head too? I have the same problem.

@dieulot
Copy link
Owner

dieulot commented Nov 2, 2014

Nope, it would load the stylesheets after the body is displayed, giving an unpleasant flash of wrongly-styled content in the beginning.

I don’t have a good solution to suggest to sites using different stylesheets on different pages, and I’m not sure we’ll ever find a silver bullet. Only a rearchitecture of one’s stylesheets will do.

@IonicaBizau
Copy link

Yeah, so definitely I have to load same CSS on all pages. Thanks for feedback.

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

4 participants