0

I've a problem with sass-rails 6 on Rails 6.1.2.1.

In my project styles i need to change textflow left-to-right (ltr) and right-to-left (rtl) depending on selected language. But it seems to be broken in 'sass-rails', '>= 6'. it raised: Undefined variable.

ActionView::Template::Error: 00:14
Error: Undefined variable: "$dir".
on line 17:14 of app/assets/stylesheets/_application.sass 00:14
>>   direction: $dir;

Here's my file structure:

# _ltr.sass

$dir: ltr
$left: left
$right: right
# _rtl.sass

$dir: rtl
$left: right
$right: left
# application.rtl.sass

@import ./_rtl
@import ./_application
# application.ltr.sass

@import ./_ltr
@import ./_application
# _application.sass

html
  font-size: 10px
  height: 100%
  width: 100%

body
  background-color: $white
  color: $black
  cursor: default
  direction: $dir

Is this behavior expected?

How to import variables in sass-rails 6, what has changed between version 5 and 6 in this usecase?

Thanks!

axcr
  • 21
  • 1
  • 2
  • I too appear to be experiencing this issue this morning. Have you managed to resolve it yet? – rctneil Mar 05 '21 at 11:19
  • I also got this issue after upgrading to `rails 6` the issue appears only in the CI build though and not in development mode ! – Gilg Him Sep 06 '21 at 08:51

0 Answers0