Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

RTL SCSS suggested instructions: Difference between revisions

From MoodleDocs
(Created page with "Suggested modifications and updates to the CSS_Coding_Style#Right-to-left page sections ==== Caveats ==== It is important to note that the special comments must NOT end...")
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:


It is important to note that the special comments must NOT end a file or a rule block. All comments not preceding a block, or a rule are ignored.
It is important to note that the special comments must NOT end a file or a rule block. All comments not preceding a block, or a rule are ignored.
Or in other words: currently the comments must always precede a statement, they will not work if they are not followed by anything.


Also note that comments in SCSS or LESS will often not produce the desired effect. When dealing with SCSS and LESS, ensure that your special RTL comments are attached to pure CSS statements: no <code>@extend</code>, indented rules, etc...
Also note that comments in SCSS or LESS will often not produce the desired effect. When dealing with SCSS and LESS, ensure that your special RTL comments are attached to pure CSS statements: no <code>@extend</code>, indented rules, etc...


=== Forcing the text direction ===
=== Forcing the text direction ===


Whilst <code>.dir-rtl</code> should not be used any more, we've added <code>.text-ltr</code> which allows developers to force the direction of the text to left-to-right. This is especially useful for forms fields (numbers, emails, URLs must not be RTL'd), and for displaying code snippets or configuration samples.
Whilst <code>.dir-rtl</code> should not be used any more, we've added <code>.text-ltr</code> which allows developers to force the direction of the text to left-to-right. This is especially needed for forms fields like: URLs, OS level Folders paths & apps, theme hex colors, English DB field names, emails, English text, numbers, regular expression patterns, symbols, code snippets or configuration samples.

Revision as of 12:33, 2 December 2016

Suggested modifications and updates to the CSS_Coding_Style#Right-to-left page sections

Caveats

It is important to note that the special comments must NOT end a file or a rule block. All comments not preceding a block, or a rule are ignored. Or in other words: currently the comments must always precede a statement, they will not work if they are not followed by anything.

Also note that comments in SCSS or LESS will often not produce the desired effect. When dealing with SCSS and LESS, ensure that your special RTL comments are attached to pure CSS statements: no @extend, indented rules, etc...

Forcing the text direction

Whilst .dir-rtl should not be used any more, we've added .text-ltr which allows developers to force the direction of the text to left-to-right. This is especially needed for forms fields like: URLs, OS level Folders paths & apps, theme hex colors, English DB field names, emails, English text, numbers, regular expression patterns, symbols, code snippets or configuration samples.