How to support RTL and LTR in sass
Handle it using sass mixins
- pros:
- Smaller output file in comparison to method #2
- You'll have a semantic sass because of using
rtl
andltr
mixins
- cons:
- You can't support both
rtl
andltr
both in a single output file
- You can't support both
- pros:
Handle it using
dir
attr ofhtml
tag- pros:
- You don't need to compile your sass file twice (you can support
rtl
andltr
in a single file)
- You don't need to compile your sass file twice (you can support
- cons:
- Your output file might get heavy because of long
css
rules
- Your output file might get heavy because of long
- pros:
Handle it using
sass
vars- pros:
- Smaller output file in comparison to method #2
- Smaller sass files in comparison to method #1
- cons:
- You can't support both
rtl
andltr
both in a single output file - Your
sass
files are not very semantic like method #1
- You can't support both
- pros: