1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-24 11:16:27 +02:00

feat: Fixed at side

This commit is contained in:
Phuoc Nguyen
2022-09-19 19:29:19 +07:00
parent 6ff4995fef
commit ca08744f4d
9 changed files with 127 additions and 311 deletions

View File

@@ -46,9 +46,12 @@ module.exports = function(eleventyConfig) {
return `<div class="lines">${content}</div>`;
});
eleventyConfig.addShortcode('rectangle', function(width) {
// `direction` can be `hor` or `ver`
eleventyConfig.addShortcode('rectangle', function(dir, size, width) {
const direction = dir || 'hor';
const s = size || 'sm';
const w = width || randomInteger(1, 4) * 20;
return `<div class="rectangle rectangle--${w}"></div>`;
return `<div class="rectangle rectangle--${direction} rectangle--${s} rectangle--${w}"></div>`;
});
eleventyConfig.addShortcode('square', function() {
return `<div class="square"></div>`;