"Blank" Glyphicon

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1869
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

"Blank" Glyphicon

Post by jsetzer » 2024-04-14 04:06

Good morning,

in a custom calendar page I have added a dropdown-button for setting filters. All dropdown options should indicate whether they are checked or not.

For checked options I can use Icon glyphgicon-ok.

Problem
As far as I know there is no "blank" glyphicon having the same width as other glyphicons, by default. So, unchecked options (without icon) will have a different indentation than checked options as you can see here:

chrome_5oF2QSo4El.png
chrome_5oF2QSo4El.png (6.55 KiB) Viewed 534 times

Personally, I dislike this. I would like to see identical text-indentation for all options.

Solution
I have found a very short CSS hack which "adds" a blank glyphicon:

Additional CSS

Code: Select all

.glyphicon-blank:before {
    content: "\2122";
    color: transparent !important;
}
  • Icon for unckecked option:
    <i class="glyphicon glyphicon-blank"></i>
    Note that glyphicon-blank does not exist, by default.
  • Icon for ckecked option:
    <i class="glyphicon glyphicon-ok"></i>

Now all options are well-aligned which I really prefer:

chrome_Lz62OAH4nH.png
chrome_Lz62OAH4nH.png (22.07 KiB) Viewed 534 times

Just wanted to share this tiny CSS hack with you!

See also:
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.14 Revision 1665 + all AppGini Helper tools


Post Reply