Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,7 @@
}

:host([selected][bordered]) .container {
border-inline-start-color: var(--calcite-color-border-1);
border-inline-end-color: var(--calcite-color-border-1);
border-inline-color: var(--calcite-internal-tabs-border-color);
}

:host([layout="inline"][bordered]),
Expand Down
16 changes: 9 additions & 7 deletions packages/calcite-components/src/components/tabs/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,30 @@
}

:host([bordered]) {
box-shadow: inset 0 1px 0 var(--calcite-color-border-1);
box-shadow: inset 0 1px 0 var(--calcite-internal-tabs-border-color);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be using box-shadow as a border??

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to affect the scope of this PR, but worth discussing. I know box-shadow + inset is used to achieve a border w/o affecting dimensions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we should discuss these type of styles where we are doing somewhat odd things to accomplish a border. The list component was doing the same thing (using margin and a box-shadow) to accomplish a border. I went ahead and changed it in that PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's anything inherently wrong with doing this - in certain places it can be helpful to maintain total height, provide a way to avoid having "compensatory padding" (when you have an active border and siblings don't) etc. Or, in cases where border is already used, to provide additional visuals. But, it probably shouldn't be the first option... I can see why it was used in Tabs in this way - I can see if a refactor is possible in #8800

background-color: var(--calcite-internal-tabs-background-color);

section {
border-color: var(--calcite-internal-tabs-border-color);
border-style: solid;
}

::slotted(calcite-tab-nav) {
margin-block-end: -1px;
}
}

section {
@apply border-color-1 border border-solid flex
border-t
flex-grow
overflow-hidden;
@apply border flex flex-grow overflow-hidden;

border-block-start-style: solid;
border-block-start-color: var(--calcite-internal-tabs-border-color);
}

:host([bordered][position="bottom"]) {
box-shadow:
inset 0 1px 0 var(--calcite-color-border-1),
inset 0 -1px 0 var(--calcite-color-border-1);
inset 0 1px 0 var(--calcite-internal-tabs-border-color),
inset 0 -1px 0 var(--calcite-internal-tabs-border-color);

::slotted(calcite-tab-nav) {
margin-block-start: -1px;
Expand Down