Skip to content

Commit

Permalink
Update rtl redo and undo buttons (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-fix authored Apr 28, 2020
1 parent d9b141a commit d220cb5
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/vaadin-rich-text-editor-icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@
[part~="toolbar-button-undo"]::before {
content: var(--vaadin-rte-icons-undo);
}

/* RTL specific styles */

:host([dir="rtl"]) [part~="toolbar-button-redo"]::before {
content: var(--vaadin-rte-icons-undo);
}

:host([dir="rtl"]) [part~="toolbar-button-undo"]::before {
content: var(--vaadin-rte-icons-redo);
}
</style>
</template>
</dom-module>
4 changes: 4 additions & 0 deletions test/visual/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

const theme = window.location.search.replace(/.*theme=(\w+).*/, '$1') || 'lumo';
document.write('<link rel="import" href="../../theme/' + theme + '/vaadin-rich-text-editor.html">');

const dir = window.location.search.replace(/.*dir=(\w+).*/, '$1') || 'ltr';
document.documentElement.setAttribute('dir', dir);

window.addEventListener('WebComponentsReady', function() {
customElements.whenDefined('vaadin-rich-text-editor').then(function() {
window.webComponentsAreReady = true; // Checked in gemini before capture callback
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions test/visual/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ gemini.suite('vaadin-rich-text-editor', function(rootSuite) {
.capture(`vaadin-rich-text-editor`);
});
});

gemini.suite(`default-${theme}-rtl`, function(suite) {
suite
.setUrl(`/default.html?theme=${theme}&dir=rtl`)
.setCaptureElements(`#default`)
.capture(`vaadin-rich-text-editor`);
});
});

});
10 changes: 10 additions & 0 deletions theme/lumo/vaadin-rich-text-editor-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@
:host([theme~="compact"]) [part~="toolbar-group"] {
margin: 0 calc(var(--lumo-space-m) / 2 - 1px);
}

/* RTL specific styles */

:host([dir="rtl"]) [part~="toolbar-button-redo"]::before {
content: var(--lumo-icons-undo);
}

:host([dir="rtl"]) [part~="toolbar-button-undo"]::before {
content: var(--lumo-icons-redo);
}
</style>
</template>
</dom-module>
Expand Down

0 comments on commit d220cb5

Please sign in to comment.