Skip to content

Add support for custom icons.#4627

Closed
natansh wants to merge 1 commit intotwbs:2.1.1-wipfrom
natansh:2.1.1-wip
Closed

Add support for custom icons.#4627
natansh wants to merge 1 commit intotwbs:2.1.1-wipfrom
natansh:2.1.1-wip

Conversation

@natansh
Copy link
Contributor

@natansh natansh commented Aug 23, 2012

Ideally, a custom icon should be as easy to add as

.icon-[custom name] {
    background-image: ...;
    background-position: ...;
}

Apparently, this used to work in 2.0.4, but no longer works in 2.1.0 - someone reported this in the mailing group. The issue is that the bootstrap styles in many elements have more specificity now, such as

.navbar-inverse .nav > .active > a > [class^="icon-"]

which makes the browser pick that particular background image (mentioned in the property).

I have been thinking of some solutions and the best I could think of was to have a separate class prefix, like

.custom-icon-[custom name]

I have added support for using this approach in the commit.

Would love to hear/know about any alternate approaches possible.

@travisbot
Copy link

This pull request passes (merged 80d4296 into ac44202).

@mdo
Copy link
Member

mdo commented Aug 23, 2012

For now we won't be adding this. I'd like to keep our icons as simple as possible and we're already bordering too complex unfortunately.

@mdo mdo closed this Aug 23, 2012
@natansh
Copy link
Contributor Author

natansh commented Aug 23, 2012

Cool, NP. Just that I have noticed one or two folks were having a problem with this, so decided to chalk out a possible solution. It might be nice to support this later on, as glyphicons don't have every icon needed.

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