Skip to content

Commit

Permalink
Use CSS Container Queries instead of Media Queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Jul 18, 2024
1 parent 2877cdd commit 763bf55
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/styles/overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
svg {
width: map.get($psv-overlay-image-size, portrait);

@media (orientation: landscape) {
@container psv-container (orientation: landscape) {
width: map.get($psv-overlay-image-size, landscape);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/styles/panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
}
}

@media screen and (max-width: #{$psv-panel-width}) {
@container psv-container (max-width: #{$psv-panel-width}) {
width: 100% !important;
max-width: none;

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/styles/viewer.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.psv-container {
--psv-core-loaded: true;
container-name: psv-container;
container-type: size;

width: 100%;
height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion packages/gallery-plugin/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ $psv-gallery-breakpoint: 500px !default;
}
}

@media screen and (width <= #{$psv-gallery-breakpoint}) {
@container psv-container (max-width: #{$psv-gallery-breakpoint}) {
top: 0;

&-container {
Expand Down
2 changes: 1 addition & 1 deletion packages/plan-plugin/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $psv-plan-transition: ease-in-out 0.3s !default;
height: calc(100% - #{$psv-navbar-height} - #{$psv-plan-margin * 2}) !important;
}

@media screen and (width < 500px) {
@container psv-container (max-width: 500px) {
margin: 0;
width: 100% !important;
height: 100% !important;
Expand Down
2 changes: 1 addition & 1 deletion packages/video-plugin/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ $psv-video-bigbutton-color: $psv-buttons-color !default;
opacity: 1;
transition-timing-function: linear, step-start;

@media (orientation: landscape) {
@container psv-container (orientation: landscape) {
width: map.get($psv-video-bigbutton-size, landscape);
}
}
Expand Down

0 comments on commit 763bf55

Please sign in to comment.