Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Icons Not Display on md Theme #4241

Open
KiddoV opened this issue Dec 27, 2023 · 0 comments
Open

Custom Icons Not Display on md Theme #4241

KiddoV opened this issue Dec 27, 2023 · 0 comments

Comments

@KiddoV
Copy link

KiddoV commented Dec 27, 2023

Describe the bug

I use Fontawesome as custom icons on the tab bar.

With the ios theme, everything works as expected:
ios

However, with the md theme, the icons disappear:
md

I notice that because on md theme, we have this CSS:

.md .tabbar i.icon::before, .md .tabbar-icons i.icon::before {
    content: ''; //<======== this override the ``FA icon class``
    width: 64px;
    height: 32px;
    border-radius: 32px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%) scaleX(0.5);
    background: var(--f7-tabbar-link-active-icon-bg-color);
    opacity: 0;
    transition-duration: 200ms;
    z-index: -1;
}

The above CSS is the rounded pills that highlight the active tab. The content: ''; would override my custom icon class for Fontawesome:

.fa-circle-dollar-to-slot:before, .fa-donate:before {
    content: "\f4b9";
}

Is there anyway to get around with this?
Can we change the rounded pill to use ::after instead of ::before so it would not conflict with Fontawesome CSS?

Thanks,

Additional contents

app.svelte

<script lang="ts">
[...]
// Application main tabs props
const main_tab_props = [
	{label: "Overview", icon: "fas fa-circle-dollar-to-slot", tab: "tab-overview", url: "/"},
	{label: "People", icon: "fas fa-users", tab: "tab-people", url: "/people/"},
	{label: "Chats", icon: "fas fa-comments-dollar", tab: "tab-chats", url: "/chats/"},
	{label: "More", icon: "fas fa-bars", tab: "tab-more", url: "/more/"}
]
[...]
</script>

[...]
    <!-- Views/Tabs container -->
    <Views tabs class="safe-areas">
        <Toolbar class="custom-icon" tabbar icons bottom>
            {#each main_tab_props as tab, i}
            <Link tabLink="#{tab.tab}" tabLinkActive={i == 0 ? true : false} icon={tab.icon} text={tab.label} />
            {/each}
        </Toolbar>
        
        <!-- Main Views -->
        {#each main_tab_props as tab, i}
        <View id={tab.tab} main={i == 0 ? true : false} tabActive={i == 0 ? true : false} tab url={tab.url} />
        {/each}
    </Views>
[...]
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

No branches or pull requests

1 participant