Skip to content

[Bug]: Vue CSS v-bind condition is broken by lightningcss #3595

Description

@ywenhao

Version

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400
    Memory: 2.23 GB / 15.75 GB
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    @rsbuild/core: ^1.0.1 => 1.0.8
    @rsbuild/plugin-vue: ^1.0.1 => 1.0.1

Details

<template>
  <div class="content" @click="color = !color">
    <h1>Rsbuild with Vue</h1>
    <p>Start building amazing things with Rsbuild.</p>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const color = ref(true)
</script>

<style scoped>
content h1 {
  font-size: 3.6rem;
  font-weight: 700;
  /* ok */
  color: v-bind("color ? 'red': 'green'");
  /* no ok */
  color: v-bind('color ? "red": "green"');
}
</style>
// mian css
 /* ok */
  color: v-bind("color ? 'red': 'green'");
  /* no ok */
  color: v-bind('color ? "red": "green"');

Reproduce Steps

yarn dev

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions