Skip to content

Instantly share code, notes, and snippets.

@dutchcelt
Last active April 25, 2023 13:01
Show Gist options
  • Select an option

  • Save dutchcelt/7654429ba2700e0ba7bbe58dec4b868a to your computer and use it in GitHub Desktop.

Select an option

Save dutchcelt/7654429ba2700e0ba7bbe58dec4b868a to your computer and use it in GitHub Desktop.
Force nested element to break out and use the width of the viewport
:host {
container: host / inline-size;
display: flex;
/* force host to be the width of the viewport */
width: 100vw;
margin-left: 50%;
transform: translateX(-50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment