Masonry: remove built-in column number condition
This commit is contained in:
parent
fbbac36b4a
commit
bb3ba32dc5
3 changed files with 12 additions and 10 deletions
|
@ -5,12 +5,7 @@
|
||||||
@supports (grid-template-rows: masonry) {
|
@supports (grid-template-rows: masonry) {
|
||||||
.NativeMasonry {
|
.NativeMasonry {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(44px, min-content));
|
grid-template-columns: repeat(auto-fit, minmax(33%, min-content));
|
||||||
grid-template-rows: masonry;
|
grid-template-rows: masonry;
|
||||||
|
|
||||||
&:has(> :last-child:nth-child(2n)) {
|
|
||||||
grid-template-columns: repeat(2, minmax(auto, min-content));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,13 @@ function MasonryNative<T extends MasonryContainer>(
|
||||||
* and fallback to masonry-layout if not supported. The children
|
* and fallback to masonry-layout if not supported. The children
|
||||||
* must have specified width and height.
|
* must have specified width and height.
|
||||||
*
|
*
|
||||||
|
* Testing native behaviour:
|
||||||
|
* - Firefox: in `about:config`, search for `layout.css.grid-template-masonry-value.enabled`
|
||||||
|
*
|
||||||
|
* Class `NativeMasonry` will be added to the element if it's under the
|
||||||
|
* css masonry layout, otherwise it's `CompatMasonry`. `Masonry` is always
|
||||||
|
* added.
|
||||||
|
*
|
||||||
* **Children Changes** As the children changed, reflow will be triggered,
|
* **Children Changes** As the children changed, reflow will be triggered,
|
||||||
* and there is might be a blink (or transition) for user. If it's not your
|
* and there is might be a blink (or transition) for user. If it's not your
|
||||||
* intention, don't remove/add the direct children. Instead wraps them under
|
* intention, don't remove/add the direct children. Instead wraps them under
|
||||||
|
|
Loading…
Reference in a new issue