Skip to content

scss background-image: url() with svg data #2993

@XpamAmAdEuS

Description

@XpamAmAdEuS

moving from webpack with really big project and have solve all problems in one day but this one seems like a bug.
Have try all 2.0 + versions.

In scss file have this.

$bg-light: "data:image/svg+xml;base64, "BIGDATA ++++";

.className {
      background-image: url($bg-light);
      background-size: 300px;
    }


[plugin:vite:css] expected ")".

213 │       background-image: url(../../../assets/scss//$bg-light);
       │                                            ^

Same project working with webpack.

Before submitting the issue, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Provide a description in this issue that describes the bug.
  • Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions