1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-23 18:56:29 +02:00

feat: Square size

This commit is contained in:
Phuoc Nguyen
2022-09-19 21:14:16 +07:00
parent ec8c32556e
commit 02b7e880ec
2 changed files with 14 additions and 4 deletions

View File

@@ -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) {