Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Commit

Permalink
Merge ad72750 into be08271
Browse files Browse the repository at this point in the history
  • Loading branch information
sarracini committed Jan 26, 2016
2 parents be08271 + ad72750 commit 97a6f87
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 30 deletions.
5 changes: 4 additions & 1 deletion bin/generate-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const defaults = {
};

function template(rawOptions) {
const options = Object.assign({}, defaults, rawOptions || {});
if (defaults.localeDir === "rtl") {
defaults.cssPath = "./main-rtl.css";
}
const options = Object.assign({}, defaults, rawOptions || {});
return `
<!DOCTYPE html>
<html dir="${options.localeDir}" lang="${options.locale}">
Expand Down
19 changes: 19 additions & 0 deletions bin/generate-rtl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /usr/bin/env node
"use strict";
const path = require("path");
const fs = require("fs");
const cssjanus = require("cssjanus");

const FILE_NAME = path.join(__dirname, "../www/main-rtl.css");
const FILE_PATH = path.join(__dirname, "../www/main.css");

function convertCSS(filePath) {
try {
var data = fs.readFileSync(filePath, "utf8");
fs.writeFileSync(FILE_NAME, cssjanus.transform(data), "utf8");
} catch (e) {
throw e;
}
}

convertCSS(FILE_PATH);
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"build:js": "NODE_ENV=production webpack -p --optimize-dedupe",
"build:css": "node-sass src/main.scss -o www",
"postbuild": "node ./bin/generate-directories --static www -o build",
"postbuild:css": "bin/generate-rtl.js",
"start": "npm run setup && npm-run-all --parallel watch:*",
"watch:css": "npm run build:css && npm run build:css -- --source-map www/main.css.map -w -r",
"watch:js": "webpack-dev-server --hot --port=1944 --content-base www",
Expand Down Expand Up @@ -43,6 +44,7 @@
"chai-as-promised": "^5.1.0",
"cli-color": "^1.1.0",
"codeclimate-test-reporter": "^0.1.0",
"cssjanus": "1.1.2",
"eslint": "^1.10.2",
"eslint-config-airbnb": "^1.0.2",
"eslint-loader": "^1.1.1",
Expand Down
11 changes: 0 additions & 11 deletions src/components/Search/Search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
outline: none;
border-color: $focus-blue;
}
&:-moz-dir(rtl) {
border: 1px solid;
border-color: rgba(23, 51, 78, 0.15) rgba(23, 51, 78, 0.17) rgba(23, 51, 78, 0.2);
border-left: none;
}
}

.search-submit {
Expand All @@ -44,9 +39,6 @@
&:hover {
background: url("chrome://browser/skin/search-arrow-go.svg#search-arrow-go-inverted") center center no-repeat, linear-gradient(#4cb1ff, #1793e5);
}
&:-moz-dir(rtl) {
border-radius: 2px 0 0 2px;
}
}

.search-input:focus + .search-submit {
Expand All @@ -63,8 +55,5 @@
background-repeat: no-repeat;
background-position: 5px center;
@include bgimage("magnifier.svg");
&:-moz-dir(rtl) {
right: 0;
}
}
}
19 changes: 1 addition & 18 deletions src/components/Settings/Settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
position: fixed;
top: 20px;
right: 20px;
left: 0;
z-index: 1;
text-align: right;
&:-moz-dir(rtl) {
right: auto;
text-align: left;
left: 20px;
}
}
.settings-toggle {
background: none;
Expand Down Expand Up @@ -83,19 +79,6 @@
}
}
}
&:-moz-dir(rtl) {
&::before {
right: auto;
left: 10px;
}
&::after {
right: auto;
left: 10px;
}
&.active {
text-align: right;
}
}
}
.settings-overlay {
display: none;
Expand Down

0 comments on commit 97a6f87

Please sign in to comment.