Skip to content

Commit

Permalink
Fix rtl mode
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Nov 15, 2019
1 parent 4716077 commit 5d2842f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ max_width: <max_width>
min_width: <min_width>
flex_grow: <flex_grow>
justify_content: <justify_content>
ltr: <ltr>
rtl: <rtl>
cards:
<cards>
card_options:
Expand Down Expand Up @@ -233,7 +233,7 @@ cards:

- `<flex_grow>` (single value or list) and `<justify_content>` (single value) can be used to tweak the CSS flexbox settings of the layout. See [this excellent guide](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) for more info.

- `<rtl>` will make the columns display from right to left instead of left to right.
- `<rtl>` will populate the columns from right to left instead of left to right.


## A few tips
Expand Down
10 changes: 3 additions & 7 deletions layout-card.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class LayoutCard extends LitElement {
this._config
);

if(this._config.rtl)
this.columns.reverse();

this.format_columns();

this.requestUpdate();
Expand Down Expand Up @@ -150,7 +153,6 @@ class LayoutCard extends LitElement {
return html`
<div id="columns"
class="
${this._config.rtl ? "rtl": " "}
${this._isPanel() ? "panel": " "}
"
style="
Expand Down Expand Up @@ -178,9 +180,6 @@ class LayoutCard extends LitElement {
justify-content: center;
margin-top: -8px;
}
#columns.rtl {
flex-direction: row-reverse;
}
#columns.panel {
margin-top: 0;
}
Expand Down

0 comments on commit 5d2842f

Please sign in to comment.