Skip to content

Commit 0e4e671

Browse files
authored
Merge pull request #54 from thuoe/feature/font-styling
Override font-family ussing CSS variables
2 parents f119d19 + 03ac07c commit 0e4e671

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Custom property | Description | Default Value
111111
`--video-menu-item-icon-hover-color` | Menu icon hover color | `white`
112112
`--video-tooltip-background-color` | Tooltip background color | `rgba(255,255,255,.9)`
113113
`--video-pulse-icon-color` | Pulse icon background color | `#d32f2f`
114+
`--video-font-family` | Font-family used throughout video player | `Arial`, `Helvetica`, `sans-serif`
114115

115116

116117
### HTML Example:

player-styles.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const playerStyles = html`
55
:host {
66
display: block;
77
user-select: none;
8+
font-family: var(--video-font-family), Arial, Helvetica, sans-serif;
89
}
910
1011
:host(:-webkit-full-screen) {

test/mp4-video-player_test.html

+4
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@
360360
suite('player styling', () => {
361361
test('CSS properties are being applied..', () => {
362362
player.updateStyles({
363+
'--video-font-family': 'Times New Roman',
363364
'--video-title-color': 'red',
364365
'--video-track-bar-color': 'blue',
365366
'--video-track-fill-color': 'green',
@@ -373,6 +374,9 @@
373374
'--video-pulse-icon-color': 'LightSteelBlue'
374375
});
375376

377+
const timeElapsed = player.shadowRoot.querySelector('.time-elapsed');
378+
assertComputed(timeElapsed, 'Times New Roman', '--video-font-family');
379+
376380
const title = player.shadowRoot.querySelector('.title');
377381
assertComputed(title, 'red', '--video-title-color');
378382

0 commit comments

Comments
 (0)