News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Disable menu icons?

Started by Mick., August 21, 2021, 03:48:15 PM

Previous topic - Next topic

Mick.

Hey, so i'd like to rid the menu icons. The menu CSS is a mile long and I've been pulling my hairs. I added my own custom navigation menu but these pesky icons keep popping up. Anyone done this yet?
https://www.idesignsmf.com/dev-site2/index.php

shadav

looking at your site
<span class="main_icons home"></span><span class="main_icons search"></span>not sure what file that's in

.main_icons::before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: url(../images/icons/main_icons_sprite.png) no-repeat -5px -5px/260px auto;
    vertical-align: middle;
}
you could change that to display: none;
or remove it entirely should get rid of it

Mick.

Quote from: shadav on August 21, 2021, 03:55:40 PMlooking at your site
<span class="main_icons home"></span><span class="main_icons search"></span>not sure what file that's in

.main_icons::before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: url(../images/icons/main_icons_sprite.png) no-repeat -5px -5px/260px auto;
    vertical-align: middle;
}
you could change that to display: none;
You done this before. Thank you, you saved me some time.

shadav

np
you may want to turn off the minify css and js in your admin settings though
so you don't have 50million different minified versions while you're still editing stuff

also added after I posted, you could just get rid of that css all together and it should get rid of the icons

Mick.

Quote from: shadav on August 21, 2021, 03:59:01 PMnp
you may want to turn off the minify css and js in your admin settings though
so you don't have 50million different minified versions while you're still editing stuff

also added after I posted, you could just get rid of that css all together and it should get rid of the icons
Thank you

Antechinus

Lol. This is one of the first things I did with the custom override I'm running here. Those Fugue icons suck donkey balls. :D

And Mick: document inspector for the win, dude. :D

Mick.


Antechinus

Do you find that the icons are annoying because they distract the eye from the text content, so make the menu harder to read?

Mick.

Quote from: Antechinus on August 21, 2021, 05:07:13 PMDo you find that the icons are annoying because they distract the eye from the text content, so make the menu harder to read?
I just dont like them.

Mick.

Anyhow, Making it to display: none; it also removes the X from the mobile menu. Cannot close the window without it. Sigh...I'll do my own mobile menu dammit.

Mick.

Making a very simple theme for 2.1

Antechinus

Off to a good start. :)

Anyway, you can (obviously) fix the mobile menu problem by using more specific CSS targeting. Just set the .main_icons::before to display: block; or whatever in the mobile menu (or anywhere else you want icons). You know this stuff, Mick. You have done this before. :D

Antechinus

Just took a look at the markup. Here ya go:
.main_icons.hide_popup {display: block;}Easy. :P

Of course this element is already floated right, which means it is already display: block; by default because (as we all know, boys and girls) any floated element is always display: block; ~ that is a fundamental part of CSS specs since the Stone Age.

So, you should never normally declare display: block; on any floated element. That is redundant code that teaches n00bs bad habits. But this is a specific override, so it's ok in this instance.

shadav

eh apparently a lot of things use that pesky css for icons

I'm not sure, I haven't tested but I think
in index.template.php
<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>'.(!empty($value['icon']) ? '<span class="main_icons '.$value['icon'].'"></span>' : '').'' . $txt[$value['text']] . '</a>';I think this is the code you are looking for

get rid of that
<span class="main_icons '.$value['icon'].'"></span>again I haven't tested, don't currently have a test rc4 running

Mick.

Quote from: shadav on August 21, 2021, 05:28:58 PMeh apparently a lot of things use that pesky css for icons

I'm not sure, I haven't tested but I think
in index.template.php
<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>'.(!empty($value['icon']) ? '<span class="main_icons '.$value['icon'].'"></span>' : '').'' . $txt[$value['text']] . '</a>';I think this is the code you are looking for

get rid of that
<span class="main_icons '.$value['icon'].'"></span>again I haven't tested, don't currently have a test rc4 running
Nope. No go.

Mick.

Quote from: Antechinus on August 21, 2021, 05:22:19 PMJust took a look at the markup. Here ya go:
.main_icons.hide_popup {display: block;}Easy. :P

Of course this element is already floated right, which means it is already display: block; by default because (as we all know, boys and girls) any floated element is always display: block; ~ that is a fundamental part of CSS specs since the Stone Age.

So, you should never normally declare display: block; on any floated element. That is redundant code that teaches n00bs bad habits. But this is a specific override, so it's ok in this instance.
This is the SignUp popup no? I'm looking to rid those icons on navigation menu

Antechinus

The main menu icons are these ones:

/* ---------------------------- */
/* Kill godforsaken menu icons. */
#main_menu .main_icons {
    display: none;
}
/* But don't kill mobile menu closing icon. */
.main_icons.hide_popup {
    display: block !important;
}

Mick.

lol thanx Ant. Obviously this is not in the css. Sorted.

Antechinus


Mick.


Advertisement: