{"id":5670,"date":"2020-06-18T05:20:47","date_gmt":"2020-06-18T05:20:47","guid":{"rendered":"https:\/\/musilda.cz\/?p=5670"},"modified":"2020-06-18T05:20:47","modified_gmt":"2020-06-18T05:20:47","slug":"jak-pouzit-ve-wordpressu-font-awesome","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-pouzit-ve-wordpressu-font-awesome\/","title":{"rendered":"Jak pou\u017e\u00edt ve WordPressu Font Awesome"},"content":{"rendered":"\n
Ikonky jsou ned\u00edlnou sou\u010d\u00e1st\u00ed ka\u017ed\u00e9ho webu. Nejpou\u017e\u00edvan\u011bj\u0161\u00ed \u0159e\u0161en\u00ed pro jejich vkl\u00e1d\u00e1n\u00ed do str\u00e1nky je Font Awesome. Uk\u00e1\u017eeme si, jak na to. <\/p>\n\n\n\n
Na za\u010d\u00e1tku byl takzvan\u00fd ikonofont. Tedy webfont, kter\u00fd m\u00edsto znak\u016f obsahoval speci\u00e1ln\u00ed symboly – ikony. <\/p>\n\n\n\n
Ka\u017ed\u00e1 ikonka m\u00e1 sv\u016fj specifick\u00fd k\u00f3d a d\u00edky css pseudoelementu :before se na m\u00edst\u011b htm tagu <i> zobraz\u00ed vybran\u00e1 ikona. <\/p>\n\n\n\n
V\u00fdhodou je jednoduch\u00e9 vkl\u00e1d\u00e1n\u00ed ikon do obsahu a jejich pou\u017eit\u00ed v designu. <\/p>\n\n\n\n
V sou\u010dasn\u00e9 dob\u011b je FontAwesome ve verzi 6, ale b\u011b\u017en\u011b se pou\u017e\u00edv\u00e1 verze 5 a ni\u017e\u0161\u00ed. <\/p>\n\n\n\n
Zp\u016fsob pou\u017eit\u00ed se d\u00e1 rozd\u011blit do dvou \u010d\u00e1st\u00ed – pou\u017eit\u00ed fontu a svg. <\/p>\n\n\n\n
Nejprve si mus\u00edme \u0159\u00edci, jak se ikony zobrazuj\u00ed v k\u00f3du. V podstat\u011b m\u00e1te na v\u00fdb\u011br dva elementy a to i a span. T\u011bm d\u00e1te css t\u0159\u00eddy, kter\u00e9 se postaraj\u00ed o p\u0159i\u0159azen\u00ed odpov\u00eddaj\u00edc\u00edho stylu ikony. Vypad\u00e1 to t\u0159eba takto:<\/p>\n\n\n\n
<i class=\"fas fa-user\"><\/i>\n<span class=\"fas fa-user\"><\/span><\/code><\/pre>\n\n\n\nPozor na to, \u017ee od verze 5 se zm\u011bnila t\u0159\u00edda fa<\/strong>. Star\u0161\u00ed verze toti\u017e pou\u017e\u00edvali tuto t\u0159\u00eddu a pokud va\u0161e \u0161ablona vkl\u00e1d\u00e1 stylopis pro verzi 4 a m\u00e1te v k\u00f3du ikony takto:<\/p>\n\n\n\n<i class=\"fa fa-user\"><\/i>\n<span class=\"fa fa-user\"><\/span><\/code><\/pre>\n\n\n\ntak p\u0159i aktualizaci stylopisu se v\u00e1m ikony mohou p\u0159estat zobrazovat. D\u016fvod , pro\u010d se t\u0159\u00edda zm\u011bnila je jednoduch\u00fd. Ozna\u010duje toti\u017e font family a t\u011bch je od verze 5 pon\u011bkud v\u00edce:<\/p>\n\n\n\n
- fas – v\u00fdchoz\u00ed font family, osobn\u011b bych ikon\u00e1m p\u0159i\u0159adil \u0159ez bold – 700. <\/li>
- far – regular \u0159ez ikon – 400<\/li>
- fal – light verze – 300<\/li>
- fad – duotone verze ikon, m\u00e1 barevn\u00e9 odst\u00edny<\/li>
- fab – brandov\u00e9 ikony<\/li><\/ul>\n\n\n\n
Ve free verzi m\u00e1te k dispozici jen fas a fab, ostatn\u00ed jsou ji\u017e sou\u010d\u00e1st\u00ed premium verze. <\/p>\n\n\n\n