Verbesserungsvorschlag: Icon statt Text für Startseite in der Navigation

Steinbam's Avatar

Steinbam

06 Feb, 2025 09:16 PM

Produkt: Oneo Contao
Contao-Version: 5.3

Hallo liebes RockSolid-Team,

gibt es die Möglichkeit, in der Navigation für die Startseite das "Haus-Icon" anstelle des Texts "Startseite" o.ä. anzuzeigen? Wir würde gerne durch das Home-Icon etwas Platz sparen. Auch auf vielen anderen Webseiten ist es ja heute verbreitet, dass für den Home-Link in der Navigation lediglich ein Haus-Icon angezeigt wird. Über die CSS-Klasse kann ich das Icon zwar hinzufügen, aber eben nur zusätzlich zum Text und nicht stattdessen.

Lässt sich das halbwegs einfach anpassen? (Oneo-Version 1.3.5)

Vielen Dank im Voraus!

  1. Support Staff 1 Posted by RockSolid Theme... on 07 Feb, 2025 10:07 AM

    RockSolid Themes's Avatar

    Vielen Dank für Ihre Frage.

    Um den Text neben dem Home-Icon auszublenden können Sie z. B. folgenden CSS-Code in die Datei files/oneo/css/custom.css einfügen:

    .main-navigation > ul > li > .icon-home > span {
        visibility: hidden;
        letter-spacing: -1em;
    }
    .main-navigation > ul > li > .icon-home::before {
        margin-right: 0;
    }
    .main-navigation > ul > li > strong.icon-home {
        letter-spacing: -1em;
        color: transparent !important;
    }
    .main-navigation > ul > li > strong.icon-home::before {
        letter-spacing: 0;
        color: #33b1ec;
    }
    

    Ersetzen Sie dabei .icon-home falls Sie ein anderes Icon einsetzen möchten und #33b1ec mit der Farbe für den Aktivstatus des Navigation.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac