Problem:
When icon is added e.g. before title you sometimes need to align content and vice versa. Block title and content have no shared parent that can be targeted by css to decide if icon is present or not.

Solution:
Add class to div.block

Comments

radimklaska’s picture

This patch adds has-icon class to every block that has icon set in block settings. It also adds class with icon possition.

radimklaska’s picture

Status: Active » Needs review
markhalliwell’s picture

Status: Needs review » Needs work

I'm ok with adding has-icon if you really want it, but the position classes I think are a little unnecessary. In reality, I'd almost say that this should be a "won't fix", try using the Block Class module.

radimklaska’s picture

StatusFileSize
new843 bytes

has-icon is enough. With other classes: I was just thinking too much ahead and actually ended up not using them.

I know about block class module, but i'm using it for "special things" rather than "site admin not breaking stuff when he chooses an icon" :-)

So here is new patch only with $variables['classes_array'][] = 'has-icon';.

markhalliwell’s picture

Status: Needs work » Fixed

Awesome, thanks!

Fixed in commit: 6731d2c.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 6731d2c on 7.x-1.x, 8.x-1.x, icon_tabs-integration authored by radimklaska, committed by Mark Carver:
    Issue #2032097 by radimklaska: "has-icon" class for blocks