Skip to content

Instantly share code, notes, and snippets.

@gmcusaro
Created July 26, 2022 06:14
Show Gist options
  • Save gmcusaro/b599c7493542e39f067ad0cc6afb384d to your computer and use it in GitHub Desktop.
Save gmcusaro/b599c7493542e39f067ad0cc6afb384d to your computer and use it in GitHub Desktop.
Shorthand width property
.container {
border: 5px solid red;
width: 100%;
max-width: 600px;
padding: 0 1em;
margin: 0 auto;
}
/* this can become */
.container {
border: 5px solid red;
width: min(100% - 2rem, 600px);
margin-inline: auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment