EastsideDev
EastsideDev

Reputation: 6639

Proper syntax for application.scss

Rails 5.1

In my Gemflie, I have the following:

gem 'sass-rails', '~> 5.0'

and I want to only use Sass in my application. When I generated the application, I had the following in my application.css file:

/*
 *= require_tree .
 *= require_self
*/ 

I copied application.css to application.scss and deleted application.css

Would I need to keep these lines in application.scss, or should I replace them with the following lime in application.scss:

@import "global";

Upvotes: 0

Views: 45

Answers (1)

Mohanraj
Mohanraj

Reputation: 4200

You are correct, you should replace require statement to @import. Below is the sample one,

@import 'bootstrap-sprockets';
@import 'bootstrap';
@import 'bootstrap_include';
@import 'dataTables/bootstrap/3/jquery.dataTables.bootstrap';
@import 'jquery-ui/core';
@import 'jquery-ui/theme';
@import 'datepicker';

So, that you should be able to use the predefined sass variables in you scss files.

Upvotes: 1

Related Questions