From 684e97a021094e498335c184ad471a214f687fbf Mon Sep 17 00:00:00 2001 From: Agney Date: Sun, 15 Sep 2019 23:19:01 +0530 Subject: [PATCH] Setup css variables --- action.yml | 6 ++++++ src/generate-html.ts | 2 ++ src/repo-props.ts | 6 +++++- src/types.ts | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 1cd1b5b..ac9280f 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,12 @@ inputs: commitMsg: description: "commit message to be shown when adding image" default: "just some wholesome content. yo all!" + background-color: + description: "background color for image" + default: "#ffffff" + font-color: + description: "font color for image" + default: "#000000" runs: using: "docker" image: "Dockerfile" diff --git a/src/generate-html.ts b/src/generate-html.ts index aa70410..df5e1a1 100644 --- a/src/generate-html.ts +++ b/src/generate-html.ts @@ -14,6 +14,8 @@ function generateHtml(prop: Partial) { } og-image-element { --heading-font: 'Aleo', serif; + --background-color: ${prop.backgroundColor}; + --font-color: ${prop.fontColor}; } diff --git a/src/repo-props.ts b/src/repo-props.ts index 703cc1b..3e49897 100644 --- a/src/repo-props.ts +++ b/src/repo-props.ts @@ -6,9 +6,13 @@ import { getInput } from "@actions/core"; async function getRepoProps() { const assetPath = getInput(`path`); const commitMsg = getInput(`commitMsg`); + const backgroundColor = getInput(`background-color`); + const fontColor = getInput(`font-color`); return { assetPath, - commitMsg + commitMsg, + backgroundColor, + fontColor }; } diff --git a/src/types.ts b/src/types.ts index 6279cd2..30d617f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -8,6 +8,8 @@ export interface IProps { subtitle: string; filename: string; imageUrl: string; + backgroundColor: string; + fontColor: string; } export interface IFrontMatter {