Next.js Discord

Discord Forum

How to link SASS with Tailwind CSS in Next.js ?

Unanswered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
i watch a tutorial that use sass with vscode extensions live sass compiler. But when i click watch, it's return error can't find stylesheet to import , which is supposed to be tailwind css

base.scss
@import "~tailwindcss/base";
@import "~tailwindcss/components";
@import "~tailwindcss/utilities";

next.config.js
/** @type {import('next').NextConfig} */
const path = require('path')

const nextConfig = {
    sassOptions: {
        includePaths: [path.join(__dirname, 'assets')]
    }
}

module.exports = nextConfig

tailwindcss
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
    './src/components/**/*.{js,ts,jsx,tsx,mdx}',
    './src/app/**/*.{js,ts,jsx,tsx,mdx}',
  ],
  theme: {
    extend: {
      backgroundImage: {
        'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
        'gradient-conic':
          'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
      },
    },
  },
  plugins: [],
}

1 Reply

American black bearOP
i was expecting to someting that can link the .scss and .css with sass map