diff --git a/README.md b/README.md index 5f458ab..5b81c30 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,7 @@ cards: column_width: max_width: min_height: + ltr: cards: ``` @@ -209,6 +210,11 @@ Optional. Default: 5 The number of units needed before a column is considered not empty. +### `` +Optional. Default: false + +If set to true, columns will be placed right-to-left. + ### `` Required. diff --git a/layout-card.js b/layout-card.js index 01702f4..29fd527 100644 --- a/layout-card.js +++ b/layout-card.js @@ -10,6 +10,7 @@ class LayoutCard extends cardTools.LitElement { this.colWidth = config.column_width || 300; this.maxWidth = config.max_width || 500; this.minHeight = config.min_height || 5; + this.rtl = config.rtl || false; this.cardSize = 1; window.addEventListener('resize', () => this.build()); @@ -28,6 +29,8 @@ class LayoutCard extends cardTools.LitElement { { this.style.padding = "0"; } + if(this.rtl) + this.shadowRoot.querySelector("#columns").style.flexDirection = 'row-reverse'; this.build(); this._cardModder = { target: this,