Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML5: Use HTML 'dir' attribute in CSS files #23

Closed
alexhass opened this issue Jun 28, 2013 · 3 comments
Closed

YAML5: Use HTML 'dir' attribute in CSS files #23

alexhass opened this issue Jun 28, 2013 · 3 comments

Comments

@alexhass
Copy link

Next Drupal 8 (release end of year 2013) has a changed approach for integrating RTL support. See below linked case for reasons and the final committed patch in #69 that has tons of example how code need to be changed.

Remove language_css_alter() (RTL stylesheets) in favor of HTML 'dir' attribute: https://drupal.org/node/2015789

Some of the key benefits are

  1. half number of CSS files (all "-rtl.css" files are removed)
  2. increases the maintainability
  3. easier SASS integration
  4. better code readability

Examples:

body {
  margin: 1em;
  background-color: #fff;
}
[dir="rtl"] body {
  direction: rtl;
}

th {
  text-align: left; /* LTR */
  color: #006;
  border-bottom: 1px solid #ccc;
}
[dir="rtl"] th {
  text-align: right;
}

For the reason that the incremental files (-rtl.css) are no longer working in Drupal 8 we really need to change this. I like this change as it makes code really easier to read as the RTL comes directly after the LTR specification. No need to search around if the RTL override exists or not and so on. It's really a lot easier.

@djesse
Copy link
Contributor

djesse commented May 8, 2015

Its great to see, that those separate files are no longer needed. I have to check where and if YAML itelf still needs much RTL related code as with YAML5 most old-IE related issues are gone and provided styling has been further reduced for prototyping. So in most cases RTL relevant styling will occur on user-basis now.

@djesse
Copy link
Contributor

djesse commented May 15, 2015

RTL support is integrated in YAML5 in this way. There are no more any additional CSS-Files needed. RTL support can be enabled/disabled via Sass variable.

@djesse djesse closed this as completed May 15, 2015
@alexhass
Copy link
Author

Great. Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants