Skip to content

Commit

Permalink
add --padding to tab panel
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Oct 4, 2021
1 parent ebd8464 commit e12ee97
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
4 changes: 0 additions & 4 deletions docs/assets/styles/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,6 @@ strong {
margin-bottom: 0;
}

.markdown-section sl-tab-panel::part(base) {
padding: var(--sl-spacing-medium) 0;
}

.docsify-pagination-container {
border-top-color: rgb(var(--sl-color-neutral-200)) !important;
}
Expand Down
1 change: 1 addition & 0 deletions docs/resources/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
- Added `--sl-surface-base` and `--sl-surface-base-alt` as early surface tokens to improve the appearance of alert, card, and panels in dark mode
- Added the `--sl-panel-border-width` design token
- Added missing background color to `<sl-details>`
- ADded the `--padding` custom property to `<sl-tab-panel>`
- Added the `outline` variation to `<sl-button>` [#522](https://github.com/shoelace-style/shoelace/issues/522)
- Added the `filled` variation to `<sl-input>`, `<sl-textarea>`, and `<sl-select>` and supporting design tokens
- Added the `control` part to `<sl-select>` so you can target the main control with CSS [#538](https://github.com/shoelace-style/shoelace/issues/538)
Expand Down
16 changes: 16 additions & 0 deletions src/components/tab-group/tab-group.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ export default css`
order: 2;
}
.tab-group--top ::slotted(sl-tab-panel) {
--padding: var(--sl-spacing-medium) 0;
}
/*
* Bottom
*/
Expand Down Expand Up @@ -135,6 +139,10 @@ export default css`
order: 1;
}
.tab-group--bottom ::slotted(sl-tab-panel) {
--padding: var(--sl-spacing-medium) 0;
}
/*
* Start
*/
Expand Down Expand Up @@ -163,6 +171,10 @@ export default css`
order: 2;
}
.tab-group--start ::slotted(sl-tab-panel) {
--padding: 0 var(--sl-spacing-medium);
}
/*
* End
*/
Expand Down Expand Up @@ -190,4 +202,8 @@ export default css`
flex: 1 1 auto;
order: 1;
}
.tab-group--end ::slotted(sl-tab-panel) {
--padding: 0 var(--sl-spacing-medium);
}
`;
4 changes: 3 additions & 1 deletion src/components/tab-panel/tab-panel.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ export default css`
${componentStyles}
:host {
--padding: 0;
display: block;
}
.tab-panel {
border: solid 1px transparent;
padding: 20px 20px;
padding: var(--padding);
}
`;
2 changes: 2 additions & 0 deletions src/components/tab-panel/tab-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ let id = 0;
* @slot - The tab panel's content.
*
* @csspart base - The component's base wrapper.
*
* @cssproperty --padding - The tab panel's padding.
*/
@customElement('sl-tab-panel')
export default class SlTabPanel extends LitElement {
Expand Down

0 comments on commit e12ee97

Please sign in to comment.