Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust internal tab spacing #115

Merged
merged 5 commits into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vaadin-tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
_repaintShadowNodesHack() {
// Safari 10 has an issue with repainting shadow root element styles when a host attribute changes.
// Need this workaround (toggle any inline css property on and off) until the issue gets fixed.
/* istanbul ignore if */
if (safari10 && this.root) {
const WEBKIT_PROPERTY = '-webkit-backface-visibility';
this.root.querySelectorAll('*').forEach(el => {
Expand Down
2 changes: 1 addition & 1 deletion test/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
});

it('should not cut content', () => {
expect(tabs[1].offsetWidth).to.be.above(130);
expect(tabs[1].offsetWidth).to.be.above(124);
expect(nav.offsetWidth).to.be.eql(400);
});
});
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.
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.
5 changes: 4 additions & 1 deletion test/visual/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
gemini.suite('vaadin-tabs', function(rootSuite) {

function wait(actions, find) {
actions.wait(5000);
return actions
.waitForJSCondition(function(window) {
return !!(window.WebComponents && window.WebComponents.ready);
}, 15000);
}

function goToAboutBlank(actions, find) {
Expand Down
10 changes: 7 additions & 3 deletions theme/lumo/vaadin-tab-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<style>
:host {
box-sizing: border-box;
padding: .25em 1em;
padding: 0.5rem 0.75rem;
font-family: var(--lumo-font-family);
font-size: var(--lumo-font-size-m);
line-height: var(--lumo-line-height-m);
line-height: var(--lumo-line-height-xs);
font-weight: 500;
text-align: center;
opacity: 1;
Expand All @@ -32,6 +32,7 @@

:host([orientation="vertical"]) {
transform-origin: 0% 50%;
padding: 0.25rem 1rem;
min-height: var(--lumo-size-m);
min-width: 0;
}
Expand Down Expand Up @@ -113,7 +114,7 @@

/* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */
:host ::slotted(iron-icon[icon^="vaadin:"]) {
padding: 0.25em;
padding: 0.25rem;
box-sizing: border-box !important;
}

Expand All @@ -129,7 +130,10 @@
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
text-align: center;
padding-bottom: 0.5rem;
padding-top: 0.25rem;
}

:host([theme~="icon-on-top"]) ::slotted(iron-icon) {
Expand Down
7 changes: 6 additions & 1 deletion theme/lumo/vaadin-tabs-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
min-height: var(--lumo-size-l);
}

:host([orientation="horizontal"]) [part="tabs"] ::slotted(vaadin-tab) {
:host([orientation="horizontal"]) [part="tabs"] ::slotted(vaadin-tab:not([theme~="icon-on-top"])) {
justify-content: center;
}

Expand All @@ -27,8 +27,13 @@
display: inline-flex;
}

:host([orientation="horizontal"]) [part="tabs"] {
margin: 0 0.75rem;
}

:host([orientation="vertical"]) [part="tabs"] {
width: 100%;
margin: 0.5rem 0;
}

[part="forward-button"],
Expand Down