Skip to content

Icon Button svg fill comment #80

Closed Answered by Deufel
Deufel asked this question in Q&A
Jan 11, 2025 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

Thanks for the quick response! Yeah I would say that 1 and 2 are not the best way to go nor maintainable. Im a bit new at all this stuff so I am usually unsure if the issue I am having is by design or if it is my poor implementation. I think that this boils down to stroke based icons vs fill based icons.

Maybe something like the following would allow the library to be more general purpose with out over committing to support every icon under the sun.

/* Icon */
    &:where(:has(svg), &.icon-only) {
        gap: 1ex;

        & svg:not([fill="none"]) {
            fill: currentColor;
        }

        & svg[stroke] {
            stroke: currentColor;
        }
    }

With Change:

With Out …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@felix-bohlin
Comment options

@Deufel
Comment options

@felix-bohlin
Comment options

Answer selected by felix-bohlin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants