Skip to content

Instantly share code, notes, and snippets.

@helabenkhalfallah
Last active March 24, 2024 10:07
Show Gist options
  • Save helabenkhalfallah/21fc1c862e4a59a84fc6a5aa22c46e98 to your computer and use it in GitHub Desktop.
Save helabenkhalfallah/21fc1c862e4a59a84fc6a5aa22c46e98 to your computer and use it in GitHub Desktop.
Container Examples
@container (max-width: 500px) {
/* Normal css styles can go here */
}
@container (min-width: 500px) {
/* Normal css styles can go here */
}
@container (width > 500px) {
/* Normal css styles can go here */
}
@container (width >= 500px) {
/* Normal css styles can go here */
}
@container (width < 500px) {
/* Normal css styles can go here */
}
@container (width <= 500px) {
/* Normal css styles can go here */
}
@container (width >= 500px) and (height >= 500px) {
/* Normal css styles can go here */
}
@container (width > 760px) not (height > 670px) {
/* Normal css styles can go here */
}
@container not (height <= 1080px) {
/* Normal css styles can go here */
}
@container (width < 500px) or (height < 500px) {
/* Normal css styles can go here */
}
@container (orientation: landscape) {
/* styles applied to descendants of this size container */
}
@container (10em <= width <= 20em) {
/* styles */
}
@container card (orientation: landscape) {
/* styles */
}
@container wide (orientation: landscape) and (min-width: 20em) {
/* styles applied to descendants of .sizeContainer if size features match */
}
@container narrow (orientation: portrait) or (max-width: 20em) {
/* styles applied to descendants of .sizeContainer if size features match */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment