[RUBY] [Rails] About scss folder structure

About scss folder structure

table of contents

  1. When changing from css to scss
  2. scss folder structure

1. Change from css to scss

I changed the css used in the program to scss. If you use scss, you can write in a nested structure, which reduces the amount of selector description and makes the code highly readable. In addition, variables can be used and it becomes possible to write like a program language. In addition, operations and functions can be used, and it is possible to eliminate redundant descriptions like conventional css. Since the folder structure changes a little in scss, I summarized it as a memorandum.

2. scss folder structure

The folder structure of scss is as follows.

folder Description
config This folder manages project configuration files and files that define variables used in scss.
mixin This folder manages mixin files used in scss.
modules A folder for managing modules. A module is a set of parts that is a collection of several elements. It can be divided according to usage such as header and footer. You can manage a set of CSS as an independent by using a module.
vendor A folder that manages library files. There is something called a library in css. A library is a file in which CSS is written in advance. A well-known CSS library is bootstrap. Efficient use of the library will greatly increase the speed of coding.
override This folder manages scss files for overwriting external libraries stored in the vendor folder.

The above is the folder structure in scss.

Recommended Posts

[Rails] About scss folder structure
About Rails 6
About Rails routing
[Rails] About ActiveJob ,!
About Rails controller
About RSpec (Rails)
[Rails] About migration files
[Rails 6] About main gems
[Rails] About active hash
About rails application server
About rails kaminari pagination
About rails version specification
MEMO about Rails 6 series
[Rails] About Slim notation
[rails] About devise defaults
Rails: About partial templates
About rails strong parameters
[Beginner] About Rails Session
about the where method (rails)
[Ruby on Rails] about has_secure_password
About naming Rails model methods
[Rails] About Rspec response test
About Rails scraping method Mechanize
[Rails] About the Punk List function
[Rails] About implementation of like function
[Rails] About helper method form_with [Basic]
Consideration about Rails and Clean Architecture