-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add slotted anchor styling for the tab #81
Comments
BTW, another possible feature here would be also to also forward click events which |
I think the best option is to wrap the tab with the anchor. Like #71. More references: |
@abdonrd I remember that use case as well, IMO it would make sense to maintain both. |
I agree with @abdonrd, what is the advantage of having to explicitly place the anchor inside the tab? What if I place two anchors inside a tab then, one to activate the tab and one for another action? Plus, what does happen when I click the tab and/or the anchor inside it? Is the tab select event triggered or the browser navigation? What if I control-click the link to open on a new (browser) tab/window (in which case tab should not be selected on the current window, but on the new one)?
Tested the PR, the only confirmed glitch from my considerations above is the selection of the tab on control/meta-click of the link, which should not happen (added a comment in the PR too). |
I'm not a Polymer expert, but could this possibly work: Update Okay, I've just read about Polymer 2.0 not supporting the |
I'm currently using anchors in tabs without issues with this custom theme: <dom-module id="vaadin-tab-link-theme" theme-for="vaadin-tab">
<template>
<style>
:host ::slotted(a) {
display: flex;
flex: 1 1 auto;
justify-content: center;
align-items: center;
align-self: stretch;
margin: -.25em -1em;
padding: .25em 1em;
color: inherit !important;
}
:host ::slotted(a:hover) {
text-decoration: none !important;
}
:host ::slotted(a) > iron-icon {
margin: 0 4px;
}
:host ::slotted(a) > iron-icon:first-child {
margin-left: 0;
}
:host ::slotted(a) > iron-icon:last-child {
margin-right: 0;
}
:host([theme~="icon-on-top"]) ::slotted(a) {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
:host([theme~="icon-on-top"]) ::slotted(a) > iron-icon {
margin: 0;
}
</style>
</template>
</dom-module> I can submit a PR with this added to the core tab theme, but IIRC @jouni had raised a warning about the |
This is also something that Flow users need when they are using |
I've just updated my previous comment using Flexbox to fit the anchor into the tab. |
The problem
As a user I want to place the anchor inside of the tab and make it to occupy the full height and width. This is now impossible because of the
padding
Solution
Add
theme="link"
similar to whatpaper-tab
does with the attribute.The text was updated successfully, but these errors were encountered: