Add option to enable both RTL and LTR styles in one stylesheet
#360 opened on 2017年3月6日
説明
Hey, first of all thank you for you work, I used lost grid in several projects and it worked great!
Is this a feature request or a bug report? Feature request.
What is the current behavior?
With the current lost grid version (8), it's only possible to use either ltr or rtl styles. To mix them in the same project, you need to define two stylesheets and prefix the related classes "manually" with e.g. [dir="rtl"] (see below).
What is the behavior that you expect? Be able to use rtl and ltr in the same stylesheet.
What's the motivation or use-case behind changing the behavior? I am currently working on a global website, including left-to-right and right-to-left pages which should both rely on the same codebase/stylesheet.
Anything else?
I could think of a new value for the direction global option, e.g.
@lost --beta-direction both;
which would render both ltr and rtl styles, but adding the dir attribute as a selector, e.g.
[dir="rtl"] .my-grid-col:nth-child(1n) { margin-left: 40px; margin-right: 0; }
[dir="ltr"] .my-grid-col:nth-child(1n) { margin-left: 0; margin-right: 40px; }
Related: https://github.com/peterramsing/lost/issues/351 & https://github.com/peterramsing/lost/pull/352
What do you think?