Skip to content

Commit 3ca5ff5

Browse files
authored
feat(flag): use emoji svg flags with (auto) sizing
This PR replaces the sprite flag backgrounds by the new emoji flags keeping existing code bases backward compatible (you still use <i class="uk flag"></i> as before) Additionally almost all countries are available now (famfamfam sprite misses a lot of flags) flags can now be sized they are autosized by current font-size if no size class is given the old sprite approach was kept into an additional theme famfamfam which one can easily switch back by changing the flag theme in theme.config
1 parent ff6e030 commit 3ca5ff5

File tree

5 files changed

+2688
-1008
lines changed

5 files changed

+2688
-1008
lines changed

src/definitions/elements/flag.less

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,19 @@
2424
*******************************/
2525

2626
i.flag:not(.icon) {
27-
display: inline-block;
28-
29-
width: @width;
30-
height: @height;
31-
32-
line-height: @height;
33-
vertical-align: @verticalAlign;
34-
margin: 0 @margin 0 0;
35-
36-
text-decoration: inherit;
37-
3827
speak: none;
39-
-webkit-font-smoothing: antialiased;
4028
backface-visibility: hidden;
4129
}
4230

43-
/* Sprite */
4431
i.flag:not(.icon):before {
32+
content: '\00A0\00A0\00A0\00A0\00A0\00A0\00A0';
4533
display: inline-block;
46-
content: '';
47-
background: url(@spritePath) no-repeat -108px -1976px;
48-
width: @width;
49-
height: @height;
34+
line-height: @flagLineHeight;
35+
background-repeat: no-repeat;
36+
background-position: center center;
37+
& when not (@flagFileType = 'svg') {
38+
background-size: contain;
39+
}
5040
}
5141

5242
.loadUIOverrides();

0 commit comments

Comments
 (0)