LESS: using font-awesome in :before

前端 未结 2 840
迷失自我
迷失自我 2021-01-02 23:13

I want to have a CSS selector for a header with custom font, color and a bullet to the left. So I want my header to use my custom font, and it\'s :before pseudo

2条回答
  •  無奈伤痛
    2021-01-02 23:27

    I had the same problem using the SASS-implementation. I changed the .@{fa-css-prefix} code so it does .@{fa-css-prefix}:before and this worked pretty fine for me. You still have to extend your base element then, but the font-style is only applied to the :before

    I actually wondered why they did it like that. I think their approach was that you have single dom elements for every icon (like the they use) and no icon in front of a button, link, list item or whatever as you would usually do it. But as far as I remember this was the case in the last fontawesome version.

提交回复
热议问题