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

How can i prevent video.js from putting styles in head #3051

Closed
sirakoff opened this issue Jan 29, 2016 · 10 comments
Closed

How can i prevent video.js from putting styles in head #3051

sirakoff opened this issue Jan 29, 2016 · 10 comments
Labels
needs: discussion Needs a broader discussion

Comments

@sirakoff
Copy link

No description provided.

@hartman
Copy link
Contributor

hartman commented Jan 29, 2016

Right now you can't. I'm another person who isn't entirely too happy with this either. I've stripped the defaults from my player already, and was also thinking of stripping the 'per video' styles. I like styles, but this whole strategy seems a little bit 'over the top' to me.

I might consider making an official patch to make this behavior configurable.

@gkatsev
Copy link
Member

gkatsev commented Jan 29, 2016

There isn't a way to do it right now.
Can you please elaborate on why? Style elements are meant to go in the HEAD, also, this makes it easier for users to use the cascading of css to make defaults or other styles be user override-able without having them resort to crazy hacks or using !important.
Thanks.

@gkatsev gkatsev added the needs: discussion Needs a broader discussion label Jan 29, 2016
@sirakoff
Copy link
Author

I use virtual-dom for manipulating the title in the head tag, but because the styles are inserted at the beginning, virtual-dom isn't able to diff properly.

@mmcc
Copy link
Member

mmcc commented Jan 29, 2016

I'm confused about what this thread is talking about. If the discussion is about the base theme getting inserted in the head, you just need to set VIDEOJS_NO_BASE_THEME to true before loading Video.js.

@gkatsev
Copy link
Member

gkatsev commented Jan 29, 2016

Oh, totally didn't remember that variable. We probably should make sure that all of the style elements we put into the head element respect that property then. The style-defaults doesn't. I don't think the style-el does either.

@mmcc
Copy link
Member

mmcc commented Jan 29, 2016

Yeah I think those styles should probably go in base-styles.

@sirakoff
Copy link
Author

VIDEOJS_NO_BASE_THEME = true didn't solve the problem. I solved it by manually adding the style tags at the end of the head tag.

Thanks!.

@gkatsev
Copy link
Member

gkatsev commented Feb 8, 2016

So, looks like the base-styles feature was never hooked up. Which is why users are still required to add the CSS manually.
However, we still end up making two more style elements and adding them to the HEAD, specifically, the style-defaults, and player-dimensions. Both of those should respect the VIDEOJS_NO_BASE_THEME property and not add an element when it is set.
In addition, I believe that the player-dimensions feature, specifically the portion of using the video dimensions as default player dimensions, isn't well liked and should get an option to disable that feature.

I'll be working on those now.

@gkatsev
Copy link
Member

gkatsev commented Feb 10, 2016

A PR for this is now available, see #3093.

@gkatsev
Copy link
Member

gkatsev commented Jul 25, 2016

This has been fixed via #3093.

@gkatsev gkatsev closed this as completed Jul 25, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: discussion Needs a broader discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants