Skip to content

Commit

Permalink
feat(design): color dynamic import
Browse files Browse the repository at this point in the history
  • Loading branch information
KimHunJin committed Oct 16, 2021
1 parent bb52fdc commit bd571d2
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .script/scss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function toScss(results) {
const [_, ...data] = results[0].result.rawData;

const colors = {};
data.forEach((it) => {
colors[it[0]] = it[1];
});

console.log(colors);
}
8 changes: 8 additions & 0 deletions assets/css/setting.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$accent: #FF4853;
$primary: #6B68F7;
$black: #000000;
$white: #FFFFFF;
$grey01: #F6F6F6;
$grey02: #DDDDDD;
$grey03: #777777;
$grey04: #3B3B3B;
6 changes: 4 additions & 2 deletions components/about/activity/card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export default ActivityCard;
font-family: Spoqa Han Sans Neo;
}
@import "~/assets/css/setting.scss";
@include desktop {
.activity-container {
border-radius: 16px;
Expand All @@ -45,7 +47,7 @@ export default ActivityCard;
line-height: 48px;
letter-spacing: -0.02em;
color: #ffffff;
color: $white;
}
.title {
margin-top: auto;
Expand All @@ -55,7 +57,7 @@ export default ActivityCard;
line-height: 27px;
letter-spacing: -0.02em;
color: #ffffff;
color: $white;
}
}
}
Expand Down
36 changes: 36 additions & 0 deletions content/color.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"results": [
{
"command": {
"func": "getData",
"kwargs": [{ "minCol": 1, "worksheetTitle": "color-palette" }, null]
},
"result": {
"rawData": [
["color name", "color"],
["accent", "#FF4853"],
["primary", "#6B68F7"],
["black", "#000000"],
["white", "#FFFFFF"],
["grey01", "#F6F6F6"],
["grey02", "#DDDDDD"],
["grey03", "#777777"],
["grey04", "#3B3B3B"]
],
"formatted": [
{ "(A)": "color name", "(B)": "color" },
{ "(A)": "accent", "(B)": "#FF4853" },
{ "(A)": "primary", "(B)": "#6B68F7" },
{ "(A)": "black", "(B)": "#000000" },
{ "(A)": "white", "(B)": "#FFFFFF" },
{ "(A)": "grey01", "(B)": "#F6F6F6" },
{ "(A)": "grey02", "(B)": "#DDDDDD" },
{ "(A)": "grey03", "(B)": "#777777" },
{ "(A)": "grey04", "(B)": "#3B3B3B" }
],
"header": ["(A)", "(B)"],
"range": "'color-palette'!A1:Z1000"
}
}
]
}
10 changes: 10 additions & 0 deletions content/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"accent": "#FF4853",
"primary": "#6B68F7",
"black": "#000000",
"white": "#FFFFFF",
"grey01": "#F6F6F6",
"grey02": "#DDDDDD",
"grey03": "#777777",
"grey04": "#3B3B3B"
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"post-update": "yarn upgrade --latest"
"post-update": "yarn upgrade --latest",
"setting": "yarn run json-to-scss ./content/setting.json ./assets/css/setting.scss --fk"
},
"repository": {
"type": "git",
Expand All @@ -31,6 +32,7 @@
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^7.18.0",
"fibers": "^5.0.0",
"json-to-scss": "^1.6.2",
"prettier": "^2.4.1",
"sass": "^1.42.1",
"sass-loader": "10"
Expand Down
Loading

0 comments on commit bd571d2

Please sign in to comment.