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

feat(action-group): add css custom properties to define gap and padding when layout is "grid" #7763

Merged
merged 2 commits into from
Sep 19, 2023
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 @@ -4,6 +4,8 @@
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-action-group-columns: Sets number of grid-template-columns when the `layout` property is `"grid"`.
* @prop --calcite-action-group-gap: Sets the gap (gutters) between rows and columns when the `layout` property is `"grid"`.
* @prop --calcite-action-group-padding: Sets the padding when the `layout` property is `"grid"`.
*/

:host {
Expand All @@ -14,6 +16,8 @@
p-0;

--calcite-action-group-columns: 3;
--calcite-action-group-gap: theme("gap.px");
--calcite-action-group-padding: theme("padding.px");
}

.container {
Expand Down Expand Up @@ -55,10 +59,9 @@
:host([layout="grid"]) .container {
@apply bg-background
grid
place-content-stretch
gap-px
p-px;

place-content-stretch;
gap: var(--calcite-action-group-gap);
padding: var(--calcite-action-group-gap);
grid-template-columns: repeat(var(--calcite-action-group-columns), auto);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,32 @@ export const gridCenteringOfActionsInAGroup = (): string => html`
</div>
`;

export const withoutDefinedGridGap_TestOnly = (): string => html` <calcite-action-group layout="grid">
<calcite-action text="Add" icon="arrow-up-left"></calcite-action>
<calcite-action text="Save" icon="chevron-up"></calcite-action>
<calcite-action text="Layers" icon="arrow-up-right"></calcite-action>
<calcite-action text="Basemaps" icon="chevron-left"></calcite-action>
<calcite-action text="Layers" icon="layers"></calcite-action>
<calcite-action text="Basemaps" icon="chevron-right"></calcite-action>
<calcite-action text="Basemaps" icon="arrow-down-left"></calcite-action>
<calcite-action text="Layers" icon="chevron-down"></calcite-action>
<calcite-action text="Basemaps" icon="arrow-down-right"></calcite-action>
</calcite-action-group>`;

export const withDefinedGridGap_TestOnly = (): string => html`
<calcite-action-group layout="grid" style="--calcite-action-group-gap: 0; --calcite-action-group-padding:0;">
<calcite-action text="Add" icon="arrow-up-left"></calcite-action>
<calcite-action text="Save" icon="chevron-up"></calcite-action>
<calcite-action text="Layers" icon="arrow-up-right"></calcite-action>
<calcite-action text="Basemaps" icon="chevron-left"></calcite-action>
<calcite-action text="Layers" icon="layers"></calcite-action>
<calcite-action text="Basemaps" icon="chevron-right"></calcite-action>
<calcite-action text="Basemaps" icon="arrow-down-left"></calcite-action>
<calcite-action text="Layers" icon="chevron-down"></calcite-action>
<calcite-action text="Basemaps" icon="arrow-down-right"></calcite-action>
</calcite-action-group>
`;

export const arabicLocale_TestOnly = (): string => html`<div style="width:400px">
<calcite-action-group expanded lang="ar">
<calcite-dropdown slot="menu-actions"> </calcite-dropdown>
Expand Down
Loading