First attempt of CSS container query

This commit is contained in:
Lim Chee Aun 2023-09-03 18:10:47 +08:00
parent 6cbbd0aa1b
commit 8cc85ecb1a

View file

@ -747,6 +747,7 @@ a[href^='http'][rel*='nofollow']:visited:not(:has(div)) {
transparent 150% transparent 150%
); );
position: relative; position: relative;
container-type: inline-size;
} }
.status-carousel:after { .status-carousel:after {
content: ''; content: '';
@ -806,11 +807,22 @@ a[href^='http'][rel*='nofollow']:visited:not(:has(div)) {
.status-carousel > ul > li:is(:empty, :has(> a:empty)) { .status-carousel > ul > li:is(:empty, :has(> a:empty)) {
display: none; display: none;
} }
/*
Assume that browsers that do support inline-size property also support container queries.
https://www.smashingmagazine.com/2021/05/css-container-queries-use-cases-migration-strategies/#progressive-enhancement-polyfills
*/
@supports not (contain: inline-size) {
@media (hover: hover) or (pointer: fine) or (min-width: 40em) { @media (hover: hover) or (pointer: fine) or (min-width: 40em) {
.status-carousel > ul { .status-carousel > ul {
scroll-snap-type: none; scroll-snap-type: none;
} }
} }
}
@container (min-width: 640px) {
.status-carousel > ul {
scroll-snap-type: none;
}
}
.status-carousel .content-container .content:only-child { .status-carousel .content-container .content:only-child {
font-size: calc(100% + 25% * max(2 - var(--content-text-weight), 0)); font-size: calc(100% + 25% * max(2 - var(--content-text-weight), 0));
} }