diff --git a/main.js b/main.js index 4fa70e0..3d53beb 100644 --- a/main.js +++ b/main.js @@ -20,6 +20,9 @@ export function createElement({ innerText, innerHTML, textContent, readOnly, chi element.childs = (childs) => { childs.forEach(child => element.appendChild(child)); return element } element.bg = (color) => { element.style.backgroundColor = color; return element } element.p = (padding) => { element.style.padding = padding; return element } + element.m = (margin) => { element.style.margin = margin; return element } + element.grid = (options) => { element.style.display = 'grid'; Object.assign(element.style, options); return element } + element.flex = (options) => { element.style.display = 'flex'; Object.assign(element.style, options); return element } return element } @@ -49,6 +52,15 @@ export class BaseElement { static p(padding) { return createElement({ style: { padding } }, this.name) } + static m(margin) { + return createElement({ style: { margin } }, this.name) + } + static grid(options) { + return createElement({ style: { display: 'grid', ...options } }, this.name) + } + static flex(options) { + return createElement({ style: { display: 'flex', ...options } }, this.name) + } } export class div extends BaseElement { diff --git a/package.json b/package.json index 3414ff1..e6a4a78 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@laniakeasupercluster/widgets", "description": "A simple widgets tracker", - "version": "1.1.1", + "version": "1.1.2", "type": "module", "main": "main.js", "author": "Laniakea Supercluster ",