Skip to content

Commit

Permalink
fix: styling import for showcase
Browse files Browse the repository at this point in the history
When importing stylesheets through the `<link>` tag, Vite optimizes multiple stylesheets and might
import them in a different order than declared. To avoid this problem, only one stylesheet is
imported per showcase, and the import is now done directly through SCSS import statements.

See vitejs/vite#4890
  • Loading branch information
jboix committed Jun 10, 2024
1 parent 240fcdb commit b342a74
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion static/showcases/blocked-segment.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Pillarbox Demo - Detect blocked segment</title>
<link rel="icon" type="image/x-icon" href="../../img/favicon.ico">
<link rel="stylesheet" href="./static-showcase.scss"/>
<link rel="stylesheet" href="./blocked-segment.scss"/>
</head>

Expand Down
2 changes: 2 additions & 0 deletions static/showcases/blocked-segment.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import './static-showcase';

.pbw-blocked-segment-notification {
position: absolute;
right: var(--size-5);
Expand Down
2 changes: 2 additions & 0 deletions static/showcases/chapters-showcase.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import './static-showcase';

.pbw-current-chapter {
position: absolute;
top: calc(var(--size-8) * -1);
Expand Down
1 change: 0 additions & 1 deletion static/showcases/chapters.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Pillarbox Demo - Display Current Chapter</title>
<link rel="icon" type="image/x-icon" href="../../img/favicon.ico">
<link rel="stylesheet" href="./static-showcase.scss"/>
<link rel="stylesheet" href="./chapters-showcase.scss"/>
</head>

Expand Down
1 change: 1 addition & 0 deletions static/showcases/playlist-showcase.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@import './static-showcase';
@import '@srgssr/pillarbox-playlist/dist/pillarbox-playlist.min.css';
3 changes: 1 addition & 2 deletions static/showcases/playlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Pillarbox Demo - Skip Credits</title>
<title>Pillarbox Demo - Playlist</title>
<link rel="icon" type="image/x-icon" href="../../img/favicon.ico">
<link rel="stylesheet" href="./static-showcase.scss"/>
<link rel="stylesheet" href="./playlist-showcase.scss"/>
</head>

Expand Down
1 change: 0 additions & 1 deletion static/showcases/skip-credits.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Pillarbox Demo - Skip Credits</title>
<link rel="icon" type="image/x-icon" href="../../img/favicon.ico">
<link rel="stylesheet" href="./static-showcase.scss"/>
<link rel="stylesheet" href="./skip-showcase.scss"/>
</head>

Expand Down
1 change: 1 addition & 0 deletions static/showcases/skip-showcase.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@import './static-showcase';
@import '@srgssr/skip-button/dist/skip-button.min.css';

0 comments on commit b342a74

Please sign in to comment.