Skip to content

Commit 0545bdd

Browse files
committed
fix(styles): make announcement bar span full viewport width
Use transform-based centering (left: 50% + translateX(-50%)) to break out of parent container margins and span edge to edge.
1 parent 0ccbb73 commit 0545bdd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

book/quarto/assets/styles/style.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,16 @@ a {
416416
border-color: rgba($crimson, 0.4) !important;
417417
border-left: 4px solid $crimson !important;
418418
color: darken($crimson, 25%) !important;
419-
width: 100% !important;
420-
max-width: 100% !important;
419+
// Break out of parent container to span full viewport width
420+
// Transform-based centering ignores parent margins
421+
position: relative !important;
422+
left: 50% !important;
423+
transform: translateX(-50%) !important;
424+
width: 100vw !important;
425+
max-width: 100vw !important;
426+
margin-left: 0 !important;
427+
margin-right: 0 !important;
428+
box-sizing: border-box !important;
421429

422430
// Dismiss button (X)
423431
.btn-close {

0 commit comments

Comments
 (0)