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
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ Display the tab buttons for a tabbed interface.
- **Name:** [core/tab-list](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-design/core-block-tab-list/)
- **Category:** [design](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-design/)
- **Parent:** core/tabs
- **Supports:** ariaLabel, color (background, text), layout (default, ~~allowOrientation~~, ~~allowVerticalAlignment~~, ~~allowWrap~~), spacing (blockGap, padding), typography (fontSize), ~~html~~, ~~lock~~, ~~visibility~~
- **Supports:** ariaLabel, color (background, text), layout (default, ~~allowOrientation~~, ~~allowVerticalAlignment~~, ~~allowWrap~~), shadow, spacing (blockGap, padding), typography (fontSize), ~~html~~, ~~lock~~, ~~visibility~~
- **Attributes:** tabs

## Tab Panel
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/tab-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
- [`spacing`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#spacing):
- `padding`: `true`
- `blockGap`: `true`
- [`shadow`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#shadow): `true`

## Context

Expand All @@ -56,6 +57,7 @@ _Defined via the [`usesContext` and `providesContext`](https://developer.wordpre
_Defined via the [`selectors`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-selectors/) property in block.json._

- **border**: `.wp-block-tab-list button`
- **shadow**: `.wp-block-tab-list button`
- **color**:
- background: `.wp-block-tab-list button`
- text: `.wp-block-tab-list button`
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/tab-list/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@
"padding": true,
"blockGap": true
}
},
"shadow": {
"__experimentalSkipSerialization": true
}
},
"selectors": {
"border": ".wp-block-tab-list button",
"shadow": ".wp-block-tab-list button",
"color": {
"background": ".wp-block-tab-list button",
"text": ".wp-block-tab-list button"
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/tab-list/edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
RichText,
__experimentalUseBorderProps as useBorderProps,
__experimentalUseColorProps as useColorProps,
__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,
__experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
} from '@wordpress/block-editor';
import {
Expand Down Expand Up @@ -34,6 +35,7 @@ function Edit( {
const colorProps = useColorProps( attributes );
const borderProps = useBorderProps( attributes );
const spacingProps = getSpacingClassesAndStyles( attributes );
const shadowProps = getShadowClassesAndStyles( attributes );
const dropdownMenuProps = useToolsPanelDropdownMenuProps();

const { tabsClientId, tabPanels, editorActiveTabIndex, activeTabIndex } =
Expand Down Expand Up @@ -152,6 +154,7 @@ function Edit( {
...colorProps.style,
...borderProps.style,
...spacingProps.style,
...shadowProps.style,
};

return (
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/tab-list/save.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
useBlockProps,
__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,
__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,
__experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
} from '@wordpress/block-editor';

Expand All @@ -16,13 +17,15 @@ export default function save( { attributes } ) {
const colorProps = getColorClassesAndStyles( attributes );
const borderProps = getBorderClassesAndStyles( attributes );
const spacingProps = getSpacingClassesAndStyles( attributes );
const shadowProps = getShadowClassesAndStyles( attributes );

const buttonClassName = clsx( colorProps.className, borderProps.className );

const buttonStyle = {
...colorProps.style,
...borderProps.style,
...spacingProps.style,
...shadowProps.style,
};

return (
Expand Down
Loading