Skip to content

Commit

Permalink
boundary toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis committed Jun 16, 2024
1 parent 773b0e0 commit 275a5a2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions public/cdn/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function setBasicStyles() {
}
[data-boundary]::after,
[data-boundary-page]::after {
display: block;
content: attr(data-boundary);
position: absolute;
bottom: -1.4em;
Expand All @@ -32,6 +31,7 @@ function setBasicStyles() {
border-radius: 0 0 0.5rem 0.5rem;
color: #fff;
background-color: #999;
display: none;
}
[data-boundary-page]::after {
top: 250px;
Expand All @@ -50,14 +50,15 @@ function setBasicStyles() {
border: 4px solid #999;
border-radius: 1rem;
pointer-events: none;
display: none;
}
[data-boundary-page]::before {
inset: -1rem 0 -2rem;
display: block;
position: absolute;
content: "";
pointer-events: none;
border: 6px solid #999;
display: none;
}
${["explore", "decide", "checkout", "inspire"]
Expand All @@ -76,13 +77,15 @@ ${["explore", "decide", "checkout", "inspire"]
)
.join("")}
html:not(.showBoundaries) [data-boundary]::before,
html:not(.showBoundaries) [data-boundary-page]::before {
display: none;
}
html:not(.showBoundaries) [data-boundary]::after,
html:not(.showBoundaries) [data-boundary-page]::after{
display: none;
.showBoundaries [data-boundary]::before,
.showBoundaries [data-boundary]::after,
.showBoundaries [data-boundary-page]::before,
.showBoundaries [data-boundary-page]::after,
:host(.showBoundaries) [data-boundary]::before,
:host(.showBoundaries) [data-boundary]::after,
:host(.showBoundaries) [data-boundary-page]::before,
:host(.showBoundaries) [data-boundary-page]::after {
display: block;
}
`;
document.head.appendChild(style);
Expand Down

0 comments on commit 275a5a2

Please sign in to comment.