Skip to content

Commit 15c53d8

Browse files
committed
TIL Rails: Replace Require With Sass Import for jQuery-UI
In order to load all of the jQuery UI css files, we need ```ruby /* *= require jquery-ui */ @import 'jquery-ui'; # DOES NOT WORK!!! ``` `@import 'jquery-ui';` does not work because SASS import will look for a file called `jquery-ui.scss`. To work around this, we can simply change it to: ```ruby @import 'jquery-ui.css'; ``` Now SASS `@import` will import the css file.
1 parent a366fa9 commit 15c53d8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Replace Require With Sass Import for jQuery-UI
2+
3+
In order to load all of the jQuery UI css files, we need
4+
5+
```ruby
6+
/*
7+
*= require jquery-ui
8+
*/
9+
10+
@import 'jquery-ui'; # DOES NOT WORK!!!
11+
```
12+
13+
`@import 'jquery-ui';` does not work because SASS import will look for a file called `jquery-ui.scss`.
14+
15+
To work around this, we can simply change it to:
16+
17+
```ruby
18+
@import 'jquery-ui.css';
19+
```
20+
21+
Now SASS `@import` will import the css file.

0 commit comments

Comments
 (0)