-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: icons documentation display (#109)
* refactor: icons documentation display providing the icons names and hiding their details behind an interactivity * chore: added icon-style data/information * refactor: providing the icon details in an overlay * refactor: using figure instead of headline element here
- Loading branch information
Showing
4 changed files
with
132 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,49 @@ | ||
<ul class="DO-NOT-COPY-THIS-CLASS-example-icon-list icons functional"> | ||
{{#unless icons}}<p>Please keep in mind that it's optional to set the variant combination of size ({{ icon-size }}) and style ({{ icon-style }}) as these are defined as default.<br>In case that you'll need another default in your project, you could overwrite the defaults by overwriting the <code>$icon-size</code> and <code>$icon-style</code> SCSS variables.</p>{{/unless }} | ||
<ol class="DO-NOT-COPY-THIS-CLASS-example-icon-list icons functional"> | ||
{{#each icons }}<li> | ||
<ul> | ||
{{#each @root.example-bgs }} | ||
<li class="DO-NOT-COPY-THIS-CLASS-example-bg-variants-{{ variant }}"> | ||
<ul> | ||
{{#each ../variants }} | ||
{{#if_eq @root.category "transportation"}} | ||
<li> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="{{ size }}" height="{{ size }}" aria-hidden="true"> | ||
<use href="../../icons/functional/images/{{ @root.category }}/{{#if style}}{{style}}{{else}}regular{{/if }}/db_ic_{{ ../../icon }}{{#if style }}_{{ style }}{{/if }}_{{ size }}.svg#icon"></use> | ||
</svg> | ||
</li> | ||
{{else}} | ||
<li> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="{{ size }}" height="{{ size }}" aria-hidden="true"> | ||
<use href="../../icons/functional/images/{{ @root.category }}/db_ic_{{ ../../icon }}{{#if style }}_{{ style }}{{/if }}_{{ size }}.svg#icon"></use> | ||
</svg> | ||
</li> | ||
{{/if_eq}} | ||
{{/each }} | ||
</ul> | ||
</li> | ||
{{/each }} | ||
</ul> | ||
<details> | ||
<summary> | ||
<figure> | ||
{{#if_eq @root.category "transportation"}} | ||
<svg xmlns="http://www.w3.org/2000/svg" width="{{ @root.icon-size }}" height="{{ @root.icon-size }}" aria-hidden="true"> | ||
<use href="../../icons/functional/images/{{ @root.category }}/{{#if style}}{{style}}{{else}}regular{{/if }}/db_ic_{{ icon }}{{#if style }}_{{ style }}{{/if }}_20.svg#icon"></use> | ||
</svg> | ||
{{else}} | ||
<svg xmlns="http://www.w3.org/2000/svg" width="{{ @root.icon-size }}" height="{{ @root.icon-size }}" aria-hidden="true"> | ||
<use href="../../icons/functional/images/{{ @root.category }}/db_ic_{{ icon }}{{#if style }}_{{ style }}{{/if }}_20.svg#icon"></use> | ||
</svg> | ||
{{/if_eq}} | ||
<figcaption>{{ icon }}{{#if style }}_{{ style }}{{/if }}</figcaption> | ||
</figure> | ||
</summary> | ||
<aside> | ||
<ol> | ||
{{#each @root.example-bgs }} | ||
<li class="DO-NOT-COPY-THIS-CLASS-example-bg-variants-{{ variant }}"> | ||
<ol> | ||
{{#each ../variants }} | ||
{{#if_eq @root.category "transportation"}} | ||
<li> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="{{ size }}" height="{{ size }}" aria-hidden="true"> | ||
<use href="../../icons/functional/images/{{ @root.category }}/{{#if style}}{{style}}{{else}}regular{{/if }}/db_ic_{{ ../../icon }}{{#if style }}_{{ style }}{{/if }}_{{ size }}.svg#icon"></use> | ||
</svg> | ||
</li> | ||
{{else}} | ||
<li> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="{{ size }}" height="{{ size }}" aria-hidden="true"> | ||
<use href="../../icons/functional/images/{{ @root.category }}/db_ic_{{ ../../icon }}{{#if style }}_{{ style }}{{/if }}_{{ size }}.svg#icon"></use> | ||
</svg> | ||
</li> | ||
{{/if_eq}} | ||
{{/each }} | ||
</ol> | ||
</li> | ||
{{/each }} | ||
</ol> | ||
<ul> | ||
<li>SCSS: <code>@include icon(glyph({{ icon }}))</code></li> | ||
<li>HTML: <code>data-icon="{{ icon }}"</code></li> | ||
</ul> | ||
</aside> | ||
</li>{{/each }} | ||
</ul> | ||
</ol> |
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 |
---|---|---|
|
@@ -6,5 +6,7 @@ | |
{ | ||
"variant": "dark" | ||
} | ||
] | ||
], | ||
"icon-size": "24", | ||
"icon-style": "outline" | ||
} |
30 changes: 21 additions & 9 deletions
30
source/_patterns/icons/illustrative/illustrative-icons.hbs
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 |
---|---|---|
@@ -1,13 +1,25 @@ | ||
<ul class="DO-NOT-COPY-THIS-CLASS-example-icon-list icons illustrative"> | ||
<ol class="DO-NOT-COPY-THIS-CLASS-example-icon-list icons illustrative"> | ||
{{#each icons }}<li> | ||
<ul> | ||
{{#each @root.example-bgs }} | ||
<li class="DO-NOT-COPY-THIS-CLASS-example-bg-variants-{{ variant }}"> | ||
<details> | ||
<summary> | ||
<figure> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" aria-hidden="true"> | ||
<use href="../../icons/illustrative/{{ @root.category }}/db_ic_il_{{ ../icon }}.svg#icon"></use> | ||
<use href="../../icons/illustrative/{{ @root.category }}/db_ic_il_{{ icon }}.svg#icon"></use> | ||
</svg> | ||
</li> | ||
{{/each }} | ||
</ul> | ||
<figcaption>{{ icon }}{{#if style }}_{{ style }}{{/if }}</figcaption> | ||
</figure> | ||
</summary> | ||
<aside> | ||
<ol> | ||
{{#each @root.example-bgs }} | ||
<li class="DO-NOT-COPY-THIS-CLASS-example-bg-variants-{{ variant }}"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" aria-hidden="true"> | ||
<use href="../../icons/illustrative/{{ @root.category }}/db_ic_il_{{ ../icon }}.svg#icon"></use> | ||
</svg> | ||
</li> | ||
{{/each }} | ||
</ol> | ||
</aside> | ||
</details> | ||
</li>{{/each }} | ||
</ul> | ||
</ol> |