You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Rails projects, you may use the @import directive to import all files within a directory, like so:
@import"components/*";
In this case, the files will imported alphabetically. Because of the nature of CSS, this can lead to unexpected behavior where one file overrides the styles of another file simply because it comes later in alphabetical order.
For this reason, we need to discourage use of this and recommend explicitly listing files within a directory instead.
If you want to require all files in a directory, you can do so a little more elegantly by placing an _index.scss file in the directory, @importing all other files in that directory there, and then importing the index file in application.scss.
The text was updated successfully, but these errors were encountered:
In Rails projects, you may use the
@import
directive to import all files within a directory, like so:In this case, the files will imported alphabetically. Because of the nature of CSS, this can lead to unexpected behavior where one file overrides the styles of another file simply because it comes later in alphabetical order.
For this reason, we need to discourage use of this and recommend explicitly listing files within a directory instead.
If you want to require all files in a directory, you can do so a little more elegantly by placing an
_index.scss
file in the directory,@importing
all other files in that directory there, and then importing the index file inapplication.scss
.The text was updated successfully, but these errors were encountered: