Cleanup styling

- Remove color override
- Simplify how the dynamic label vs cog icon is styled
- Don't use !important, but specificity to override video.js
- Use more isolated method to center the menu.
This commit is contained in:
Derk-Jan Hartman 2016-04-23 17:36:32 +02:00
parent dc3383cc48
commit c1a41a4635
2 changed files with 24 additions and 31 deletions

View file

@ -1,12 +1,11 @@
.vjs-resolution-button { .vjs-resolution-button.vjs-menu-icon {
color: #ccc;
font-family: VideoJS; font-family: VideoJS;
font-weight: normal;
font-style: normal;
} }
.vjs-resolution-button .vjs-resolution-button-staticlabel:before { .vjs-resolution-button.vjs-menu-icon:before {
content: '\f110'; content: '\f110';
font-size: 1.8em;
line-height: 1.67;
} }
.vjs-resolution-button .vjs-resolution-button-label { .vjs-resolution-button .vjs-resolution-button-label {
@ -19,19 +18,15 @@
height: 100%; height: 100%;
text-align: center; text-align: center;
box-sizing: inherit; box-sizing: inherit;
font-family: Arial, Helvetica, sans-serif;
} }
.vjs-resolution-button ul.vjs-menu-content { .vjs-resolution-button .vjs-menu .vjs-menu-content {
width: 4em !important; width: 4em;
} left: 50%; /* Center the menu, in it's parent */
margin-left: -2em; /* half of width, to center */
.vjs-resolution-button .vjs-menu {
left: 0;
} }
.vjs-resolution-button .vjs-menu li { .vjs-resolution-button .vjs-menu li {
text-transform: none; text-transform: none;
font-size: 1em; font-size: 1em;
font-family: Arial, Helvetica, sans-serif;
} }

View file

@ -117,10 +117,8 @@
if(settings.dynamicLabel){ if(settings.dynamicLabel){
this.el().appendChild(label); this.el().appendChild(label);
}else{ } else {
var staticLabel = document.createElement('span'); videojs.addClass(this.el(), 'vjs-menu-icon');
videojs.addClass(staticLabel, 'vjs-resolution-button-staticlabel');
this.el().appendChild(staticLabel);
} }
}, },
createItems: function(){ createItems: function(){