Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about style import of scss+svelte+astro #6551

Closed
1 task done
mydracula opened this issue Mar 15, 2023 · 3 comments · Fixed by #6566 or #6816
Closed
1 task done

Questions about style import of scss+svelte+astro #6551

mydracula opened this issue Mar 15, 2023 · 3 comments · Fixed by #6566 or #6816
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: styling Related to styles (scope)

Comments

@mydracula
Copy link

mydracula commented Mar 15, 2023

What version of astro are you using?

latest

Are you using an SSR adapter? If so, which one?

none

What package manager are you using?

npm

What operating system are you using?

Windows

What browser are you using?

Chrome

Describe the Bug

1.How to import base.scss globally,I want to use @include or @extend

import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
import svelte from '@astrojs/svelte';

saving
export default defineConfig({
  integrations: [mdx(), sitemap(), svelte()],
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: '@use "src/styles/base.scss" as *;',
        },
      },
    },
  },
});

2.if the import is displayed,I use@import '$styles/variables.scss';

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-v55sfg?file=src/components/Test.svelte

Participation

  • I am willing to submit a pull request for this issue.
@bluwy
Copy link
Member

bluwy commented Mar 15, 2023

I don't think aliases from tsconfig work in css/scss at the moment, is that the issue you're facing?

@bluwy bluwy added the feat: styling Related to styles (scope) label Mar 15, 2023
@mydracula
Copy link
Author

yes I want to know how to use the path with astro and scss

@bluwy bluwy self-assigned this Mar 16, 2023
@bluwy bluwy added the - P3: minor bug An edge case that only affects very specific usage (priority) label Mar 16, 2023
@bholmesdev
Copy link
Contributor

Reopening after merging this revert PR! This change introduced regressions we will need to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: styling Related to styles (scope)
Projects
None yet
3 participants