Skip to content

[Question] – Sass @import globally available #149

Closed
@silvestreh

Description

@silvestreh

Say I have a main app.scss which imports other things like color variables, a CSS reset, and Animate.css.

// app.scss
@import 'partials/colors';
@import 'vendor/normalize';
@import 'vendor/animate';

I then use this app.scss file in my main App.vue component.

<!-- App.vue -->
<template>
    <my-component></my-component>
</template>
<style lang="scss" src="./app.scss"></style>
<script>…</script>

How can I use those color variables and @extend Animate.css classes from within other components? For now I've resorted to @importing them all over again, but it's not a nice solution and (I think) it duplicates the code.

<!-- myComponent.vue -->
<template>…</template>
<style lang="scss">
.myComponent {
    @extend .animated; // fails unless I @import animate.css again.
}
</style>
<script>…</script>

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

    Issue actions