balmjs / balm-ui

:diamonds: A modular and customizable UI library based on Material Design and Vue
https://material.balmjs.com
MIT License
506 stars 30 forks source link

Flatpickr Includes #86

Closed amathieson closed 2 years ago

amathieson commented 2 years ago

An issue I have faced for a little while was to do with compiling with Flatpickr, I don't know if I am alone with this issue, but the way I solved it was to edit components/picker/_ui-picker.scss to make the @use paths relative

elf-mouse commented 2 years ago

Hi @winer222 , Dart Sass can load plain old .css files (about flatpickr).

If you're working on a project built independently with webpack, it might have something to do with the sass-loader's includePaths option

amathieson commented 2 years ago

Hi @elf-mouse thanks for the reply, this project does use webpack / laravel mix. I am not super familiar with sass-loader's configurations, below is my webpack.mix.js file. if you could point me in the right direction that would be very appreciated. Thanks again, Adam Mathieson

// webpack.mix.js

let mix = require('laravel-mix');

mix
    .js('src/app.js', 'dist/app.js').js('src/login.js', 'dist/login.js').vue()
    .sass('src/app.scss', 'dist/app.css').sass('src/login.scss', 'dist/login.css').setResourceRoot('/').setPublicPath('')
    .extract(['leaflet','vue','vue-router','balm-ui']);
mix.version();
mix.browserSync('127.0.0.1:80');
// mix.browserSync({});

if (mix.inProduction()) {
    mix.then(() => {
        const convertToFileHash = require("laravel-mix-make-file-hash");
        convertToFileHash({
            publicPath: "",
            manifestFilePath: "mix-manifest.json"
        });
    });
}
SparK-Cruz commented 2 years ago

I'm on vue3 and the use of flatpickr also bit me SassError: Can't find stylesheet to import.

elf-mouse commented 2 years ago

Hi @winer222 @SparK-Cruz , I've verified that it's because the sass-loader in a manual project doesn't have a webpack-like resolve.modules by default configuration.

So, we need to configure it manually, like this:

Have a great weekend! Thanks again :)

amathieson commented 2 years ago

Thanks for the reply and the pointers in the right direction! Your patch worked perfectly! (I have also started supporting the project on Patreon to show my appreciation for your work ;) )

elf-mouse commented 2 years ago

@winer222 , Thank you very much for supporting BalmUI. I will always sync with Google MDC to restore and extend Material Design for vue as much as possible.