We've moved discussions to Discord

How to include CSS from a gem?

Matthias Orgler
I try to add the simple_calendar gem (https://github.com/excid3/simple_calendar) to my JSP app. But I don't know, where to put the import for the CSS of the gem.

I see several `application.[s]css` files, but none seems to be the correct one (on is in lib/jumpstart, the other in `assets/stylesheets/administrate`). The closest thing to an application.scss I could find was `assets/stylesheets/application.tailwind.css`. However, if I put the 
@import "simple_calendar";
 in the latter, I get:

Error: Failed to find 'simple_calendar'
css    |   in [
css    |     /Users/morgler/code/gix2/app/assets/stylesheets
css    |   ]
css    |     at /Users/morgler/code/gix2/node_modules/postcss-import/lib/resolve-id.js:35:13
css    |     at async LazyResult.runAsync (/Users/morgler/code/gix2/node_modules/tailwindcss/peers/index.js:5153:15)
css    |     at async rebuild (/Users/morgler/code/gix2/node_modules/tailwindcss/lib/cli.js:640:27)
css    |     at async /Users/morgler/code/gix2/node_modules/tailwindcss/lib/cli.js:672:21

The simple_calendar gem is definitely install and its view helpers already work. Just the styling is missing.

What am I missing? Where do I import CSS that comes with a gem?
Zmago Devetak
I have a same problem. I tried to copy the https://github.com/excid3/simple_calendar/blob/master/app/assets/stylesheets/simple_calendar.scss and include in components but it didn't work 🤔
Mark Nelson
I couldn't get this to work either and decided to go with the new Tailwind UI calendar component styling in conjunction with simple_calendar. You include the relevant styling in the index (or show) view you are using for the calendar and change the app/views/simple_calendar/_month_calendar.html.erb partial. This gives you something like the month view here: link
Matthias Orgler
I also used individual styling as a workaround. Now with the new TailwindUI calendars it makes even more sense – thanks Mark!
Matthias Orgler
I try to add the simple_calendar gem (https://github.com/excid3/simple_calendar) to my JSP app. But I don't know, where to put the import for the CSS of the gem.

I see several `application.[s]css` files, but none seems to be the correct one (on is in lib/jumpstart, the other in `assets/stylesheets/administrate`). The closest thing to an application.scss I could find was `assets/stylesheets/application.tailwind.css`. However, if I put the 
@import "simple_calendar";
 in the latter, I get:

Error: Failed to find 'simple_calendar'
css    |   in [
css    |     /Users/morgler/code/gix2/app/assets/stylesheets
css    |   ]
css    |     at /Users/morgler/code/gix2/node_modules/postcss-import/lib/resolve-id.js:35:13
css    |     at async LazyResult.runAsync (/Users/morgler/code/gix2/node_modules/tailwindcss/peers/index.js:5153:15)
css    |     at async rebuild (/Users/morgler/code/gix2/node_modules/tailwindcss/lib/cli.js:640:27)
css    |     at async /Users/morgler/code/gix2/node_modules/tailwindcss/lib/cli.js:672:21

The simple_calendar gem is definitely install and its view helpers already work. Just the styling is missing.

What am I missing? Where do I import CSS that comes with a gem?
Zmago Devetak
I have a same problem. I tried to copy the https://github.com/excid3/simple_calendar/blob/master/app/assets/stylesheets/simple_calendar.scss and include in components but it didn't work 🤔
Mark Nelson
I couldn't get this to work either and decided to go with the new Tailwind UI calendar component styling in conjunction with simple_calendar. You include the relevant styling in the index (or show) view you are using for the calendar and change the app/views/simple_calendar/_month_calendar.html.erb partial. This gives you something like the month view here: link
Matthias Orgler
I also used individual styling as a workaround. Now with the new TailwindUI calendars it makes even more sense – thanks Mark!
Notifications
You’re not receiving notifications from this thread.
© 2022 Jumpstart Pro by GoRails, LLC