Skip to content

support SCSS :export{} ? #1279

Closed
Closed
@carlosyan1807

Description

@carlosyan1807

export.scss

$text-color: #7f848e;
$text-color-highlight: #cccccc;

:export {
  textColor: $text-color;
  textColorHightlight: $text-color-highlight;
}

Vite & Vue 3, App.vue

import scssVariables from 'export.scss'

setup() {
  const scss = ref(scssVariables)
  console.log(scss.value)
  return {
    scss
  }
}

console

:export {
  textColor: #7f848e;
  textColorHightlight: #cccccc;
}

the result of scss is a String type, not an Object.
its work fine in vue2.x, scss returns an Object, can directly use scss.textColor to get the variable in <script> or <template>.
I haven't tested the results in Vue3 without vite, but I think it should because vite.

Activity

yyx990803

yyx990803 commented on Jan 2, 2021

@yyx990803
Member

Probably not going to support anything beyond current pre-processor support scope. Use CSS modules instead.

locked and limited conversation to collaborators on Jul 16, 2021
Shinigami92

Shinigami92 commented on Aug 10, 2022

@Shinigami92
Member

Solution: #9601

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yyx990803@Shinigami92@carlosyan1807

        Issue actions

          support SCSS :export{} ? · Issue #1279 · vitejs/vite