-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(web-twig): Add
spacing
property to Grid
- Loading branch information
Showing
8 changed files
with
200 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/web-twig/src/Resources/components/Grid/__tests__/__fixtures__/gridSpacing.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<Grid cols="{{ { mobile: 2, tablet: 3, desktop: 4 } }}" spacing="space-1000"> | ||
<span>col 1</span> | ||
<span>col 2</span> | ||
<span>col 3</span> | ||
<span>col 4</span> | ||
<span>col 5</span> | ||
<span>col 6</span> | ||
</Grid> | ||
|
||
<Grid cols="{{ { mobile: 2, tablet: 3, desktop: 4 } }}" spacingY="space-400"> | ||
<span>col 1</span> | ||
<span>col 2</span> | ||
<span>col 3</span> | ||
<span>col 4</span> | ||
<span>col 5</span> | ||
<span>col 6</span> | ||
</Grid> | ||
|
||
<Grid cols="{{ { mobile: 2, tablet: 3, desktop: 4 } }}" spacingX="space-400"> | ||
<span>col 1</span> | ||
<span>col 2</span> | ||
<span>col 3</span> | ||
<span>col 4</span> | ||
<span>col 5</span> | ||
<span>col 6</span> | ||
</Grid> | ||
|
||
<Grid cols="{{ { mobile: 2, tablet: 3, desktop: 4 } }}" spacing="{{ { mobile: 'space-600', tablet: 'space-1000', desktop: 'space-1200' } }}"> | ||
<span>col 1</span> | ||
<span>col 2</span> | ||
<span>col 3</span> | ||
<span>col 4</span> | ||
<span>col 5</span> | ||
<span>col 6</span> | ||
</Grid> | ||
|
||
<Grid cols="{{ { mobile: 2, tablet: 3, desktop: 4 } }}" spacingY="{{ { mobile: 'space-600', tablet: 'space-1000', desktop: 'space-1200' } }}"> | ||
<span>col 1</span> | ||
<span>col 2</span> | ||
<span>col 3</span> | ||
<span>col 4</span> | ||
<span>col 5</span> | ||
<span>col 6</span> | ||
</Grid> | ||
|
||
<Grid cols="{{ { mobile: 2, tablet: 3, desktop: 4 } }}" spacingX="{{ { mobile: 'space-600', tablet: 'space-1000', desktop: 'space-1200' } }}"> | ||
<span>col 1</span> | ||
<span>col 2</span> | ||
<span>col 3</span> | ||
<span>col 4</span> | ||
<span>col 5</span> | ||
<span>col 6</span> | ||
</Grid> |
32 changes: 32 additions & 0 deletions
32
...web-twig/src/Resources/components/Grid/__tests__/__snapshots__/gridSpacing.twig.snap.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title> | ||
</title> | ||
</head> | ||
<body> | ||
<div class="Grid Grid--cols-2 Grid--tablet--cols-3 Grid--desktop--cols-4" style="--grid-column-gap: var(--spirit-space-1000); --grid-row-gap: var(--spirit-space-1000);"> | ||
<span>col 1</span> <span>col 2</span> <span>col 3</span> <span>col 4</span> <span>col 5</span> <span>col 6</span> | ||
</div> | ||
|
||
<div class="Grid Grid--cols-2 Grid--tablet--cols-3 Grid--desktop--cols-4" style="--grid-row-gap: var(--spirit-space-400);"> | ||
<span>col 1</span> <span>col 2</span> <span>col 3</span> <span>col 4</span> <span>col 5</span> <span>col 6</span> | ||
</div> | ||
|
||
<div class="Grid Grid--cols-2 Grid--tablet--cols-3 Grid--desktop--cols-4" style="--grid-column-gap: var(--spirit-space-400);"> | ||
<span>col 1</span> <span>col 2</span> <span>col 3</span> <span>col 4</span> <span>col 5</span> <span>col 6</span> | ||
</div> | ||
|
||
<div class="Grid Grid--cols-2 Grid--tablet--cols-3 Grid--desktop--cols-4" style="--grid-column-gap: var(--spirit-space-600); --grid-row-gap: var(--spirit-space-600);--grid-column-gap-tablet: var(--spirit-space-1000); --grid-row-gap-tablet: var(--spirit-space-1000);--grid-column-gap-desktop: var(--spirit-space-1200); --grid-row-gap-desktop: var(--spirit-space-1200);"> | ||
<span>col 1</span> <span>col 2</span> <span>col 3</span> <span>col 4</span> <span>col 5</span> <span>col 6</span> | ||
</div> | ||
|
||
<div class="Grid Grid--cols-2 Grid--tablet--cols-3 Grid--desktop--cols-4" style="--grid-row-gap: var(--spirit-space-600);--grid-row-gap-tablet: var(--spirit-space-1000);--grid-row-gap-desktop: var(--spirit-space-1200);"> | ||
<span>col 1</span> <span>col 2</span> <span>col 3</span> <span>col 4</span> <span>col 5</span> <span>col 6</span> | ||
</div> | ||
|
||
<div class="Grid Grid--cols-2 Grid--tablet--cols-3 Grid--desktop--cols-4" style="--grid-column-gap: var(--spirit-space-600);--grid-column-gap-tablet: var(--spirit-space-1000);--grid-column-gap-desktop: var(--spirit-space-1200);"> | ||
<span>col 1</span> <span>col 2</span> <span>col 3</span> <span>col 4</span> <span>col 5</span> <span>col 6</span> | ||
</div> | ||
</body> | ||
</html> |
5 changes: 5 additions & 0 deletions
5
packages/web-twig/src/Resources/components/Grid/stories/GridCustomSpacing.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Grid cols="4" spacing="space-1000"> | ||
{% for i in 1..4 %} | ||
<DocsBox size="small">1/2, 1/3, 1/4</DocsBox> | ||
{% endfor %} | ||
</Grid> |
9 changes: 9 additions & 0 deletions
9
packages/web-twig/src/Resources/components/Grid/stories/GridResponsiveCustomSpacing.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Grid | ||
cols="{{ { mobile: 2, tablet: 3, desktop: 4 } }}" | ||
spacingX="{{ { mobile: 'space-1000', tablet: 'space-900', desktop: 'space-1200' } }}" | ||
spacingY="{{ { mobile: 'space-800', tablet: 'space-1000', desktop: 'space-0' } }}" | ||
> | ||
{% for i in 1..4 %} | ||
<DocsBox size="small">1/2, 1/3, 1/4</DocsBox> | ||
{% endfor %} | ||
</Grid> |
5 changes: 5 additions & 0 deletions
5
...s/web-twig/src/Resources/components/Grid/stories/GridResponsiveCustomVerticalSpacing.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Grid cols="{{ { mobile: 2, tablet: 3, desktop: 4 } }}" spacingY="{{ { mobile: 'space-400', tablet: 'space-800', desktop: 'space-100' } }}"> | ||
{% for i in 1..4 %} | ||
<DocsBox size="small">1/2, 1/3, 1/4</DocsBox> | ||
{% endfor %} | ||
</Grid> |