mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-06 06:07:33 +02:00
feat: Square size
This commit is contained in:
@@ -53,8 +53,9 @@ module.exports = function(eleventyConfig) {
|
||||
const w = width || randomInteger(1, 4) * 20;
|
||||
return `<div class="rectangle rectangle--${direction} rectangle--${s} rectangle--${w}"></div>`;
|
||||
});
|
||||
eleventyConfig.addShortcode('square', function() {
|
||||
return `<div class="square"></div>`;
|
||||
eleventyConfig.addShortcode('square', function(size) {
|
||||
const s = size || 'sm';
|
||||
return `<div class="square square--${s}"></div>`;
|
||||
});
|
||||
// `corner` can be one of `t`, `r`, `b`, `l`, `tr`, `br`, `tl`, `bl`
|
||||
eleventyConfig.addShortcode('triangle', function(corner, size) {
|
||||
|
@@ -1,6 +1,15 @@
|
||||
.square {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 0.25rem;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
height: var(--square-size);
|
||||
width: var(--square-size);
|
||||
}
|
||||
.square--sm {
|
||||
--square-size: 0.5rem;
|
||||
}
|
||||
.square--md {
|
||||
--square-size: 2rem;
|
||||
}
|
||||
.square--lg {
|
||||
--square-size: 4rem;
|
||||
}
|
Reference in New Issue
Block a user