Skip to content

Commit

Permalink
Docs(web-twig): Add Icons demo #DS-900
Browse files Browse the repository at this point in the history
- Icons layout synced with other packages
  • Loading branch information
pavelklibani committed Sep 14, 2023
1 parent d235e8d commit 2d9742f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 7 additions & 0 deletions apps/web-twig-demo/src/Controller/IconsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ private function getWebIcons(): array
// sort them alphabetically
sort($icons);

// remove unwanted 'sprite' from the array
$filterCallback = function ($value) {
return $value !== 'sprite';
};

$icons = array_filter($icons, $filterCallback);

return $icons;
}
}
12 changes: 5 additions & 7 deletions packages/web-twig/src/Resources/icons/Icons.stories.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

{% block content %}

<section class="docs-Section">
<DocsSection title="Icons">

<h2 class="typography-heading-medium-text text-secondary-disabled mb-700 mb-tablet-900">Icons</h2>

<ul class="Grid Grid--cols-2 Grid--tablet--cols-4 Grid--desktop--cols-6 list-unstyled text-center my-1000">
<Grid elementType="ul" cols={2} tablet={4} desktop={6} UNSAFE_className="text-center my-1000 list-unstyled">

{% for icon in icons %}
<li class="mb-600">
<Icon name={{ icon }} />

<h3 class="mt-500">{{ icon }}</h3>
<Text UNSAFE_className="mt-500" emphasis="bold">{{ icon }}</Text>
</li>
{% endfor %}

</ul>
</Grid>

</section>
</DocsSection>

{% endblock %}

0 comments on commit 2d9742f

Please sign in to comment.