Skip to content

Problems with fill inside style tag #10

@javierartero

Description

@javierartero

Describe the bug
when the color is in a style this is converted to an attribute but it is not replaced, I think it should be delayed to replace so that this does not happen

To Reproduce
use svgpack on an image with fill color inside style tag

Expected behavior
should replace the value of the fill in the function by the parameter $color

Screenshots

  • Original
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><defs><style>.cls-1{fill:#fff;}</style></defs>
  • svgpack
@function uae-icon($color: #FFF) {
  $color: str-replace(inspect($color), '#', '%23'); //fix and replace hexcolor
  @return url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' data-name='Layer 1' viewBox='0 0 300 300'%3E%3Cpath fill='%23fff' ..............;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions