Zaraka
Joined 4/7/2022
Zaraka said about 2 years ago on Slim Select with Stimulus :
Hello, I'm trying to use this in Rails 7 with importmaps, I've replaced stimulus with hotwired stimulus and it runs fine but I'm unable to import slim select stylesheet.
If I keep 
import "slim-select/dist/slimselect.css"
in stimulus controller I receive following javascript error in console
Uncaught Error: Unable to resolve specifier 'slim-select/dist/slimselect.css' from http://0.0.0.0:3000/...
I have only limited knowledge with stimulus and importams, but the slim-select itself is pinned and I have slim-select package in node_modules, so what I'm doing wrong?

Thank you for your help

Zaraka said about 2 years ago on Slim Select with Stimulus :
That explains a lot of my confusion, I started digging and I'm using cssbundling-rails with tailwind, so I have tailwind.application.css, what I understood is I can't use import in tailwind.application.css and I should use tailwind in postcss or set a separate preprocessor altogether.   
So I have tried to install css:install:postcss rename my application.postcss.css to somethingelse.postcss.css my stylesheet link also requires my "somethingelse"
in package.json I have updated build:css command to include both preprocessorlike this 

"build:css": "postcss ./app/assets/stylesheets/somethingelse.postcss.css -o ./app/assets/builds/somethingelse.css --watch && tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css"

Well it will compile both files, and both files are also included in the page, but the import statements are not working (in somethingelse.postcss.css @import "slim-select/dist/slimselect.css"; resolves to nothing) and also my now my profile which contains 

css: yarn build:css --watch
is unable to actually watch any of the files, I have to build css manually.

This is so confusing, the rails docs are missing documentation on this subject I have little to no idea what I should do.

Zaraka said about 2 years ago on Slim Select with Stimulus :
I understand that decision.
Anyway, if anyone else runs into these issues, the solution is to use tailwindcss command with --postcss argument, then if postcss-import package is installed import commands starts working correctly and slim-select is resolved and bundled.