Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Some tweaks to better support rtl #3551

Merged
merged 1 commit into from
May 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion frontend/src/app/components/ExperimentRowCard/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@import '../../../styles/_utils';

.experiment-summary {

@include flex-container(column, flex-start, stretch);

@include respond-to('big') {
Expand Down Expand Up @@ -137,3 +136,11 @@
height: 40px;
opacity: .9;
}

html[dir="rtl"] .experiment-summary {
@include respond-to('big') {
&:nth-child(3n+1) {
margin-left: 40px;
}
}
}
6 changes: 5 additions & 1 deletion frontend/src/app/components/NewsletterFooter/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ $email-icon--responsive-unit: .66;
$error-border: #c4c4c4;
$error-background: #f2f2f2;


.newsletter-footer {
background: $transparent-white-05;
padding: ($grid-unit * 1.75) 0;
Expand Down Expand Up @@ -119,3 +118,8 @@ $error-background: #f2f2f2;
}
}
}

html[dir="rtl"] .newsletter-footer header {
background: url('./img/envelope.svg') no-repeat right;
padding-right: $email-icon--width + ($grid-unit * 1.5);
}
8 changes: 7 additions & 1 deletion frontend/src/app/containers/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@ class App extends Component {
this.props.chooseTests();
this.measurePageview();

const lang = window.navigator.language;

// set lang attr on <html> for a11y
document.documentElement.setAttribute("lang", window.navigator.language);
document.documentElement.setAttribute("lang", lang);

// we should expand upon this in the future, but this should get us
// working for arabic
document.documentElement.setAttribute("dir", (lang === "ar" ? "rtl" : "ltr"));

const langs = {};

Expand Down