Skip to content

Commit

Permalink
support color alias
Browse files Browse the repository at this point in the history
  • Loading branch information
ZYinMD committed Dec 10, 2018
1 parent b6af299 commit 72e2aaa
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
37 changes: 24 additions & 13 deletions palettes/sepia/palette.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
// this file will be used both by node and by browser

var palette = {
default: '#836e69',
grey: '#999c',
red: '#f00',
maroon: '#c10c',
green: '#094e',
blue: '#08bd',
yellow: '#b82',
grey: '#836e69',
silver: '#999c',
black: '#2d2d2d',
pink: '#f08c',
purple: '#940094ab',
cyan: '#30a195',
magenta: '#b36d',
maroon: '#c10c',
red: '#f00',
orange: '#f77b00e6',
yellow: '#b82',
tan: '#97733dd0',
olive: '#890',
pink: '#f08c',
green: '#094e',
cyan: '#30a195',
blue: '#08bd',
teal: '#088',
tan: '#97733dd0',
magenta: '#b36d',
black: '#2d2d2d'
};

var alias = {
default: palette.grey,
variable: palette.olive,
function: palette.green,
parameter: palette.yellow,
module: palette.maroon,
declaration: palette.blue,
}

try {
module.exports = palette;
module.exports = Object.assign(palette, alias);
} catch (err) {
// the exports can be used in node, browser doesn't understand it, but browser can use the palette.
}
8 changes: 3 additions & 5 deletions palettes/sepia/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.default {
.grey {
color: #0008;
color: #222b;
color: #333b;
Expand All @@ -11,7 +11,7 @@

}

.grey {
.silver {
color: #999c;
color: #999d;
}
Expand Down Expand Up @@ -89,13 +89,11 @@
color: #b36e;
color: #bb3366d6;
color: #b36d;
color: #2d2d2d;

}

.black {
color: #000;

color: #2d2d2d;
}

body {
Expand Down

0 comments on commit 72e2aaa

Please sign in to comment.