mirror of
https://github.com/tabler/tabler.git
synced 2025-12-21 17:34:25 +04:00
Flag component
This commit is contained in:
22
pages/_docs/flags.md
Normal file
22
pages/_docs/flags.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: Flags
|
||||
menu: docs.flags
|
||||
---
|
||||
|
||||
## Flag
|
||||
|
||||
{% example html %}
|
||||
{% include ui/flag.html name="tg" class="mr-1" %}
|
||||
{% include ui/flag.html name="br" class="mr-1" %}
|
||||
{% include ui/flag.html name="pt" %}
|
||||
{% endexample %}
|
||||
|
||||
## Flag sizes
|
||||
|
||||
{% example html %}
|
||||
{% include ui/flag.html name="tg" class="flag-size-xl mr-1" %}
|
||||
{% include ui/flag.html name="br" class="flag-size-lg mr-1" %}
|
||||
{% include ui/flag.html name="pt" class="flag-size-md" %}
|
||||
{% include ui/flag.html name="gb" class="mr-1" %}
|
||||
{% include ui/flag.html name="gr" class="flag-size-sm" %}
|
||||
{% endexample %}
|
||||
1
pages/_includes/ui/flag.html
Normal file
1
pages/_includes/ui/flag.html
Normal file
@@ -0,0 +1 @@
|
||||
<span class="flag flag-{{ include.name }}{% if include.class %} {{ include.class }}{% endif %}"></span>
|
||||
@@ -1,11 +1,14 @@
|
||||
---
|
||||
title: Flags
|
||||
page-title: Flags
|
||||
done: true
|
||||
---
|
||||
<div class="d-flex flex-row flex-wrap">
|
||||
{% for flag in site.data.flags %}
|
||||
<div class="d-flex flex-column text-center m-3">
|
||||
<p class="d-inline-block">{{flag.name}}</p>
|
||||
<span class="flag flag-{{flag.flag}} my-3 mx-auto"></span>
|
||||
<code>.flag .flag-{{flag.flag}}</code>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% for flag in site.data.flags %}
|
||||
<div class="d-flex flex-column text-center m-3">
|
||||
<p class="d-inline-block">{{flag.name}}</p>
|
||||
{% include ui/flag.html name=flag.flag class="my-3 mx-auto" %}
|
||||
<code>.flag .flag-{{flag.flag}}</code>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@@ -19,13 +19,14 @@
|
||||
.flag {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 1.3333em;
|
||||
height: 1em;
|
||||
line-height: 1em;
|
||||
width: 2em;
|
||||
height: 2rem;
|
||||
line-height: 2rem;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 50%;
|
||||
background-size: contain;
|
||||
border-radius: 2px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.flag::before {
|
||||
@@ -39,3 +40,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
@each $avatar-size, $size in $avatar-sizes {
|
||||
.flag-size-#{$avatar-size} {
|
||||
width: $size;
|
||||
height: $size;
|
||||
line-height: $size;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user