From 5d66802759b39ed303b7f6b1defca8a92a1a7fdc Mon Sep 17 00:00:00 2001 From: mhmo91 Date: Mon, 4 Dec 2023 13:21:38 +0200 Subject: [PATCH] . --- package.json | 2 +- src/layout/grid/grid.ts | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index df81c1e..ee69b2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mhmo91/schmancy", - "version": "0.0.6", + "version": "0.0.7", "description": "UI library build with web components", "main": "./dist/index.js", "repository": { diff --git a/src/layout/grid/grid.ts b/src/layout/grid/grid.ts index d6174dc..0937f48 100644 --- a/src/layout/grid/grid.ts +++ b/src/layout/grid/grid.ts @@ -12,10 +12,8 @@ export class SchmancyGrid extends Layout { @property({ type: String }) align: 'start' | 'center' | 'end' | 'stretch' | 'baseline' = 'stretch' @property({ type: String }) justify: 'start' | 'center' | 'end' | 'stretch' = 'stretch' @property({ type: String }) gap: 'none' | 'sm' | 'md' | 'lg' = 'none' - @property({ type: Number }) cols?: number - @property({ type: String }) templateCol?: string - @property({ type: Number }) rows?: number - @property({ type: String }) templateRow?: string + @property({ type: String }) cols?: string + @property({ type: String }) rows?: string @property({ type: Object }) anime: anime.AnimeParams = {} @property({ type: Boolean }) wrap = false @@ -55,11 +53,9 @@ export class SchmancyGrid extends Layout { 'flex-wrap': !this.wrap, } const style = { - gridTemplateRows: this.templateRow ? this.templateRow : undefined, - gridTemplateColumns: this.templateCol ? this.templateCol : undefined, + gridTemplateRows: this.rows ? this.rows : undefined, + gridTemplateColumns: this.cols ? this.cols : undefined, } - if (typeof this.cols === 'number') style['grid-template-columns'] = `repeat(${this.cols}, minmax(0, 1fr))` - if (typeof this.rows === 'number') style['grid-template-rows'] = `repeat(${this.rows}, minmax(0, 1fr))` return html`