Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unnecessary usage of the single fa class #3848

Closed
wants to merge 1 commit into from

Conversation

elboletaire
Copy link

As all icon classes begin with fa- we can remove the need to use the single fa class.

Before this change you need to define your icons like this:

<span class="fa fa-glass"></span>

With this change, you'll only need to do:

<span class="fa-glass"></span>

As all icon classes begin with `fa-` we can remove the need to use the single `fa` class.

Before this change you need to define your icons like this:

`<span class="fa fa-glass"></span>`

With this change, you'll only need to do:

`<span class="fa-glass"></span>`
@tagliala
Copy link
Member

tagliala commented Jul 3, 2014

Hi,

this was intentionally done in 4.0.0 in order to avoid universal selectors like

[class^="fa-"],
[class*=" fa-"] { ... }

because of performance.

More info:
http://stackoverflow.com/questions/19407451/how-to-profile-css-selectors (unanswered)
https://gist.github.com/tagliala/7174356

@tagliala tagliala closed this Jul 3, 2014
@elboletaire
Copy link
Author

From the first link...

Given the speed at which selectors are parsed, you'd be better off focusing on other aspects of the website which could use a performance gain.

As developers we loose more than 40ms each time we need to add the single fa class.

But it's ok, it's your project and your decission. I'll work my fork then... 😄

@aleixfabra
Copy link

👍 @elboletaire

@tagliala
Copy link
Member

tagliala commented Jul 3, 2014

refers to #2454 (and to less/less.js/issues/1485)

with a proper mixin, a fork should not be needed for this purpose

@elboletaire
Copy link
Author

A proper mixin work only if I do everything with less.

.my-post {
    .icon(glass);
}

But I apply many icons using only html, that's why I need a fork.

<a class="my-post"><span class="fa-glass"></span> My link</a>

Or are you proposing me anything different? @tagliala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants