From 647cf69215f6293f924df03417134babab1739a1 Mon Sep 17 00:00:00 2001 From: Cole Bemis Date: Tue, 7 Sep 2021 14:20:19 -0700 Subject: [PATCH] Delete `data/colors_v2` directory (#233) * Delete data/colors_v2 directory * Remove v2 stats action * Remove temporary script * Create rotten-worms-lick.md --- .changeset/rotten-worms-lick.md | 5 + .github/v2-coverage.js | 44 -- .github/workflows/v2-stats.yml | 27 - data/colors_v2/deprecations.json | 397 ------------- data/colors_v2/index.ts | 11 - data/colors_v2/prefix | 1 - data/colors_v2/themes/dark.ts | 66 --- data/colors_v2/themes/dark_dimmed.ts | 62 --- data/colors_v2/themes/dark_high_contrast.ts | 203 ------- data/colors_v2/themes/light.ts | 66 --- data/colors_v2/vars/app_dark.ts | 171 ------ data/colors_v2/vars/app_light.ts | 171 ------ data/colors_v2/vars/component_dark.ts | 146 ----- data/colors_v2/vars/component_light.ts | 147 ----- data/colors_v2/vars/deprecated.ts | 589 -------------------- data/colors_v2/vars/global_dark.ts | 94 ---- data/colors_v2/vars/global_light.ts | 94 ---- data/colors_v2/vars/marketing_dark.ts | 85 --- data/colors_v2/vars/marketing_light.ts | 85 --- script/generate-deprecations.ts | 59 -- 20 files changed, 5 insertions(+), 2518 deletions(-) create mode 100644 .changeset/rotten-worms-lick.md delete mode 100644 .github/v2-coverage.js delete mode 100644 .github/workflows/v2-stats.yml delete mode 100644 data/colors_v2/deprecations.json delete mode 100644 data/colors_v2/index.ts delete mode 100644 data/colors_v2/prefix delete mode 100644 data/colors_v2/themes/dark.ts delete mode 100644 data/colors_v2/themes/dark_dimmed.ts delete mode 100644 data/colors_v2/themes/dark_high_contrast.ts delete mode 100644 data/colors_v2/themes/light.ts delete mode 100644 data/colors_v2/vars/app_dark.ts delete mode 100644 data/colors_v2/vars/app_light.ts delete mode 100644 data/colors_v2/vars/component_dark.ts delete mode 100644 data/colors_v2/vars/component_light.ts delete mode 100644 data/colors_v2/vars/deprecated.ts delete mode 100644 data/colors_v2/vars/global_dark.ts delete mode 100644 data/colors_v2/vars/global_light.ts delete mode 100644 data/colors_v2/vars/marketing_dark.ts delete mode 100644 data/colors_v2/vars/marketing_light.ts delete mode 100644 script/generate-deprecations.ts diff --git a/.changeset/rotten-worms-lick.md b/.changeset/rotten-worms-lick.md new file mode 100644 index 000000000..0cb1be408 --- /dev/null +++ b/.changeset/rotten-worms-lick.md @@ -0,0 +1,5 @@ +--- +"@primer/primitives": patch +--- + +Delete experimental `data/colors_v2` directory diff --git a/.github/v2-coverage.js b/.github/v2-coverage.js deleted file mode 100644 index d6b2a5289..000000000 --- a/.github/v2-coverage.js +++ /dev/null @@ -1,44 +0,0 @@ -const { default: colors } = require("../dist/js/colors"); -const { default: colorsV2 } = require("../dist/js/colors_v2"); -const flatten = require("flat"); -const { Octokit } = require("@octokit/rest"); - -// This is a temporary script for tracking the coverage of the v2 functional color system. -// Delete this file when the v2 system is fully implemented. - -const [repoOwner, repoName] = process.env.GITHUB_REPOSITORY.split("/"); -const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }); - -async function run() { - const variablesV1 = Object.keys(flatten(colors.light)); - const variablesV2 = Object.keys(flatten(colorsV2.light)); - - // V1 - V2 - const diff = variablesV1.filter(v => variablesV2.indexOf(v) === -1); - - console.log( - "The following v1 variables do not have a corresponding v2 variable:" - ); - - for (const variable of diff) { - console.log(variable); - } - - const coverage = - ((variablesV1.length - diff.length) / variablesV1.length) * 100; - - if (octokit) { - await octokit.repos.createCommitStatus({ - owner: repoOwner, - repo: repoName, - sha: process.env.GITHUB_SHA, - context: "v2 coverage", - state: "success", - description: `${variablesV1.length - diff.length}/${ - variablesV1.length - } (${coverage.toFixed(2)}%)`, - }); - } -} - -run(); diff --git a/.github/workflows/v2-stats.yml b/.github/workflows/v2-stats.yml deleted file mode 100644 index 42504e2d8..000000000 --- a/.github/workflows/v2-stats.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This is a temporary workflow for tracking the coverage of the v2 functional color system. -# Delete this file when the v2 system is fully implemented. - -name: v2 stats -on: [push] -jobs: - stats: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@master - - - name: Set up Node.js - uses: actions/setup-node@master - with: - node-version: 12 - - - name: Install dependencies - run: yarn - - - name: Build - run: yarn build - - - name: Compute coverage - run: node .github/v2-coverage.js - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/data/colors_v2/deprecations.json b/data/colors_v2/deprecations.json deleted file mode 100644 index 4097dcfb7..000000000 --- a/data/colors_v2/deprecations.json +++ /dev/null @@ -1,397 +0,0 @@ -{ - "auto.black": null, - "auto.white": null, - "auto.gray.0": null, - "auto.gray.1": null, - "auto.gray.2": null, - "auto.gray.3": null, - "auto.gray.4": null, - "auto.gray.5": null, - "auto.gray.6": null, - "auto.gray.7": null, - "auto.gray.8": null, - "auto.gray.9": null, - "auto.blue.0": null, - "auto.blue.1": null, - "auto.blue.2": null, - "auto.blue.3": null, - "auto.blue.4": null, - "auto.blue.5": null, - "auto.blue.6": null, - "auto.blue.7": null, - "auto.blue.8": null, - "auto.blue.9": null, - "auto.green.0": null, - "auto.green.1": null, - "auto.green.2": null, - "auto.green.3": null, - "auto.green.4": null, - "auto.green.5": null, - "auto.green.6": null, - "auto.green.7": null, - "auto.green.8": null, - "auto.green.9": null, - "auto.yellow.0": null, - "auto.yellow.1": null, - "auto.yellow.2": null, - "auto.yellow.3": null, - "auto.yellow.4": null, - "auto.yellow.5": null, - "auto.yellow.6": null, - "auto.yellow.7": null, - "auto.yellow.8": null, - "auto.yellow.9": null, - "auto.orange.0": null, - "auto.orange.1": null, - "auto.orange.2": null, - "auto.orange.3": null, - "auto.orange.4": null, - "auto.orange.5": null, - "auto.orange.6": null, - "auto.orange.7": null, - "auto.orange.8": null, - "auto.orange.9": null, - "auto.red.0": null, - "auto.red.1": null, - "auto.red.2": null, - "auto.red.3": null, - "auto.red.4": null, - "auto.red.5": null, - "auto.red.6": null, - "auto.red.7": null, - "auto.red.8": null, - "auto.red.9": null, - "auto.purple.0": null, - "auto.purple.1": null, - "auto.purple.2": null, - "auto.purple.3": null, - "auto.purple.4": null, - "auto.purple.5": null, - "auto.purple.6": null, - "auto.purple.7": null, - "auto.purple.8": null, - "auto.purple.9": null, - "auto.pink.0": null, - "auto.pink.1": null, - "auto.pink.2": null, - "auto.pink.3": null, - "auto.pink.4": null, - "auto.pink.5": null, - "auto.pink.6": null, - "auto.pink.7": null, - "auto.pink.8": null, - "auto.pink.9": null, - "text.primary": "fg.default", - "text.secondary": "fg.muted", - "text.tertiary": "fg.muted", - "text.placeholder": "fg.subtle", - "text.disabled": "fg.muted", - "text.inverse": "fg.onEmphasis", - "text.link": "accent.fg", - "text.danger": "danger.fg", - "text.success": "success.fg", - "text.warning": "attention.fg", - "text.white": null, - "icon.primary": "fg.default", - "icon.secondary": "fg.muted", - "icon.tertiary": "fg.muted", - "icon.info": "accent.fg", - "icon.danger": "danger.fg", - "icon.success": "success.fg", - "icon.warning": "attention.fg", - "border.primary": "border.default", - "border.secondary": "border.muted", - "border.tertiary": "neutral.muted", - "border.overlay": "border.default", - "border.inverse": "fg.onEmphasis", - "border.info": "accent.emphasis", - "border.danger": "danger.emphasis", - "border.success": "success.emphasis", - "border.warning": "attention.emphasis", - "bg.canvas": "canvas.default", - "bg.canvasMobile": null, - "bg.canvasInverse": "neutral.emphasis", - "bg.canvasInset": "canvas.inset", - "bg.primary": "canvas.default", - "bg.secondary": "canvas.subtle", - "bg.tertiary": "canvas.subtle", - "bg.overlay": "canvas.overlay", - "bg.backdrop": "primer.canvas.backdrop", - "bg.info": "accent.subtle", - "bg.infoInverse": "accent.emphasis", - "bg.danger": "danger.subtle", - "bg.dangerInverse": "danger.emphasis", - "bg.success": "success.subtle", - "bg.successInverse": "success.emphasis", - "bg.warning": "attention.subtle", - "bg.warningInverse": "attention.emphasis", - "shadow.highlight": "primer.shadow.highlight", - "shadow.inset": "primer.shadow.inset", - "state.hover.primaryBg": "accent.emphasis", - "state.hover.primaryBorder": "accent.emphasis", - "state.hover.primaryText": "fg.onEmphasis", - "state.hover.primaryIcon": "fg.onEmphasis", - "state.hover.secondaryBg": "neutral.subtle", - "state.hover.secondaryBorder": "neutral.subtle", - "state.selected.primaryBg": "accent.emphasis", - "state.selected.primaryBorder": "accent.emphasis", - "state.selected.primaryText": "fg.onEmphasis", - "state.selected.primaryIcon": "fg.onEmphasis", - "state.focus.border": "accent.emphasis", - "state.focus.shadow": "primer.shadow.focus", - "fade.fg10": null, - "fade.fg15": null, - "fade.fg30": null, - "fade.fg50": null, - "fade.fg70": null, - "fade.fg85": null, - "fade.black10": null, - "fade.black15": null, - "fade.black30": null, - "fade.black50": null, - "fade.black70": null, - "fade.black85": null, - "fade.white10": null, - "fade.white15": null, - "fade.white30": null, - "fade.white50": null, - "fade.white70": null, - "fade.white85": null, - "alert.info.text": "fg.default", - "alert.info.icon": "accent.fg", - "alert.info.bg": "accent.subtle", - "alert.info.border": "accent.muted", - "alert.warn.text": "fg.default", - "alert.warn.icon": "attention.fg", - "alert.warn.bg": "attention.subtle", - "alert.warn.border": "attention.muted", - "alert.error.text": "fg.default", - "alert.error.icon": "danger.fg", - "alert.error.bg": "danger.subtle", - "alert.error.border": "danger.muted", - "alert.success.text": "fg.default", - "alert.success.icon": "success.fg", - "alert.success.bg": "success.subtle", - "alert.success.border": "success.muted", - "autocomplete.shadow": "shadow.medium", - "autocomplete.rowBorder": "border.muted", - "blankslate.icon": "fg.muted", - "counter.text": "fg.default", - "counter.bg": "neutral.muted", - "counter.primary.text": "fg.onEmphasis", - "counter.primary.bg": "neutral.emphasis", - "counter.secondary.text": "fg.muted", - "counter.secondary.bg": "neutral.subtle", - "box.blueBorder": "accent.muted", - "box.rowYellowBg": "attention.subtle", - "box.rowBlueBg": "accent.subtle", - "box.headerBlueBg": "accent.subtle", - "box.headerBlueBorder": "accent.muted", - "box.borderInfo": "accent.muted", - "box.bgInfo": "accent.subtle", - "box.borderWarning": "attention.muted", - "box.bgWarning": "attention.subtle", - "branchName.text": "fg.muted", - "branchName.icon": "fg.muted", - "branchName.bg": "accent.subtle", - "branchName.link.text": "accent.fg", - "branchName.link.icon": "accent.fg", - "branchName.link.bg": "accent.subtle", - "markdown.codeBg": "neutral.muted", - "markdown.frameBorder": "border.default", - "markdown.blockquoteBorder": "border.default", - "markdown.tableBorder": "border.default", - "markdown.tableTrBorder": "border.muted", - "filterItem.barBg": "neutral.subtle", - "hiddenTextExpander.bg": "neutral.muted", - "hiddenTextExpander.bgHover": "accent.muted", - "dragAndDrop.border": "border.default", - "uploadEnabled.border": "border.default", - "uploadEnabled.borderFocused": "accent.emphasis", - "previewableCommentForm.border": "border.default", - "verifiedBadge.text": "success.fg", - "verifiedBadge.bg": "canvas.default", - "verifiedBadge.border": "border.default", - "socialCount.bg": "canvas.default", - "tooltip.text": "fg.onEmphasis", - "tooltip.bg": "neutral.emphasisPlus", - "filesExplorerIcon": "accent.fg", - "hlAuthorBg": "accent.subtle", - "hlAuthorBorder": "accent.muted", - "logoSubdued": "neutral.muted", - "discussionBorder": "success.muted", - "discussionBgSuccess": "success.emphasis", - "actionsWorkflowTableStickyBg": "primer.canvas.sticky", - "repoLanguageColorBorder": "primer.border.contrast", - "codeSelectionBg": "accent.muted", - "highlight.text": "fg.default", - "highlight.bg": "attention.subtle", - "blob.lineHighlightBg": "attention.subtle", - "blob.lineHighlightBorder": "attention.muted", - "topicTag.text": "accent.fg", - "topicTag.bg": "accent.subtle", - "topicTag.hoverBg": "accent.emphasis", - "topicTag.activeBg": "accent.subtle", - "footerInvertocat.octicon": "fg.subtle", - "footerInvertocat.octiconHover": "fg.muted", - "dropdown.shadow": "shadow.large", - "label.border": "border.default", - "label.primary.text": "fg.default", - "label.primary.border": "neutral.emphasis", - "label.secondary.text": "fg.muted", - "label.secondary.border": "border.default", - "label.info.text": "accent.fg", - "label.info.border": "accent.emphasis", - "label.success.text": "success.fg", - "label.success.border": "success.emphasis", - "label.warning.text": "attention.fg", - "label.warning.border": "attention.emphasis", - "label.danger.text": "danger.fg", - "label.danger.border": "danger.emphasis", - "label.orange.text": "severe.fg", - "label.orange.border": "severe.emphasis", - "input.bg": "canvas.default", - "input.contrastBg": "canvas.inset", - "input.border": "border.default", - "input.shadow": "primer.shadow.inset", - "input.disabledBorder": "border.default", - "input.warningBorder": "attention.emphasis", - "input.errorBorder": "danger.emphasis", - "input.tooltip.success.text": "fg.default", - "input.tooltip.success.bg": "success.subtle", - "input.tooltip.success.border": "success.muted", - "input.tooltip.warning.text": "fg.default", - "input.tooltip.warning.bg": "attention.subtle", - "input.tooltip.warning.border": "attention.muted", - "input.tooltip.error.text": "fg.default", - "input.tooltip.error.bg": "danger.subtle", - "input.tooltip.error.border": "danger.muted", - "toast.text": "fg.default", - "toast.bg": "canvas.default", - "toast.border": "border.default", - "toast.shadow": "shadow.large", - "toast.icon": "fg.onEmphasis", - "toast.iconBg": "accent.emphasis", - "toast.iconBorder": null, - "toast.success.text": "fg.default", - "toast.success.border": "border.default", - "toast.success.icon": "fg.onEmphasis", - "toast.success.iconBg": "success.emphasis", - "toast.success.iconBorder": null, - "toast.warning.text": "fg.default", - "toast.warning.border": "border.default", - "toast.warning.icon": "fg.default", - "toast.warning.iconBg": "attention.emphasis", - "toast.warning.iconBorder": null, - "toast.danger.text": "fg.default", - "toast.danger.border": "border.default", - "toast.danger.icon": "fg.onEmphasis", - "toast.danger.iconBg": "danger.emphasis", - "toast.danger.iconBorder": null, - "toast.loading.text": "fg.default", - "toast.loading.border": "border.default", - "toast.loading.icon": "fg.onEmphasis", - "toast.loading.iconBg": "neutral.emphasis", - "toast.loading.iconBorder": null, - "timeline.text": "fg.muted", - "timeline.badgeSuccessBorder": null, - "timeline.targetBadgeBorder": "accent.emphasis", - "timeline.targetBadgeShadow": "accent.muted", - "diffstat.neutralBg": "neutral.muted", - "diffstat.neutralBorder": "border.subtle", - "diffstat.deletionBorder": "border.subtle", - "diffstat.additionBorder": "border.subtle", - "diffstat.deletionBg": "danger.emphasis", - "diff.addition.text": "fg.default", - "diff.addition.bg": "success.subtle", - "diff.addition.border": "success.muted", - "diff.deletion.text": "fg.default", - "diff.deletion.bg": "danger.subtle", - "diff.deletion.border": "danger.muted", - "diff.change.text": "attention.fg", - "diff.change.bg": "attention.subtle", - "diff.change.border": "attention.muted", - "mergeBox.successIconBg": "success.emphasis", - "mergeBox.successIconText": "fg.onEmphasis", - "mergeBox.successIconBorder": null, - "mergeBox.successIndicatorBg": "success.emphasis", - "mergeBox.successIndicatorBorder": null, - "mergeBox.mergedIconBg": "done.emphasis", - "mergeBox.mergedIconText": "fg.onEmphasis", - "mergeBox.mergedIconBorder": null, - "mergeBox.mergedBoxBorder": "done.emphasis", - "mergeBox.neutralIconBg": "neutral.emphasis", - "mergeBox.neutralIconText": "fg.onEmphasis", - "mergeBox.neutralIconBorder": null, - "mergeBox.neutralIndicatorBg": "neutral.emphasis", - "mergeBox.neutralIndicatorBorder": null, - "mergeBox.warningIconBg": "attention.emphasis", - "mergeBox.warningIconText": "fg.onEmphasis", - "mergeBox.warningIconBorder": null, - "mergeBox.warningBoxBorder": "attention.emphasis", - "mergeBox.warningMergeHighlight": null, - "mergeBox.errorIconBg": "danger.emphasis", - "mergeBox.errorIconText": "fg.onEmphasis", - "mergeBox.errorIconBorder": null, - "mergeBox.errorIndicatorBg": "danger.emphasis", - "mergeBox.errorIndicatorBorder": null, - "underlinenav.border": null, - "underlinenav.borderHover": "neutral.muted", - "underlinenav.borderActive": "primer.border.active", - "underlinenav.text": "fg.default", - "underlinenav.textHover": "fg.default", - "underlinenav.textActive": "fg.default", - "underlinenav.icon": "fg.subtle", - "underlinenav.iconHover": "fg.subtle", - "underlinenav.iconActive": "fg.default", - "underlinenav.counterText": "fg.default", - "underlinenav.counterBg": "neutral.muted", - "selectMenu.borderSecondary": "border.muted", - "selectMenu.shadow": "shadow.large", - "selectMenu.backdropBg": "primer.canvas.backdrop", - "sidenav.borderActive": "primer.border.active", - "menu.headingText": "fg.default", - "menu.borderActive": "primer.border.active", - "project.cardBg": "canvas.overlay", - "prState.draft.text": "fg.onEmphasis", - "prState.draft.bg": "neutral.emphasis", - "prState.draft.border": null, - "prState.open.text": "fg.onEmphasis", - "prState.open.bg": "success.emphasis", - "prState.open.border": null, - "prState.merged.text": "fg.onEmphasis", - "prState.merged.bg": "done.emphasis", - "prState.merged.border": null, - "prState.closed.text": "fg.onEmphasis", - "prState.closed.bg": "danger.emphasis", - "prState.closed.border": null, - "diffBlob.numText": "fg.subtle", - "diffBlob.numHoverText": "fg.default", - "diffBlob.addition.numHoverText": "fg.default", - "diffBlob.deletion.numHoverText": "fg.default", - "diffBlob.deletion.lineBg": "danger.subtle", - "diffBlob.deletion.wordBg": "danger.muted", - "diffBlob.hunk.text": "fg.muted", - "diffBlob.hunk.numBg": "accent.muted", - "diffBlob.hunk.lineBg": "accent.subtle", - "diffBlob.emptyBlockBg": "neutral.subtle", - "diffBlob.selectedLineHighlightBg": "attention.subtle", - "diffBlob.selectedLineHighlightBorder": "attention.muted", - "diffBlob.expander.hoverIcon": "fg.onEmphasis", - "diffBlob.expander.hoverBg": "accent.emphasis", - "diffBlob.commentButton.icon": "fg.onEmphasis", - "diffBlob.commentButton.bg": "accent.emphasis", - "diffBlob.commentButton.gradientBg": null, - "globalNav.logo": null, - "globalNav.bg": null, - "globalNav.text": null, - "globalNav.icon": null, - "globalNav.inputBg": null, - "globalNav.inputBorder": null, - "globalNav.inputIcon": null, - "globalNav.inputPlaceholder": null, - "introShelf.gradientLeft": "accent.subtle", - "introShelf.gradientRight": "success.subtle", - "introShelf.gradientIn": "canvas.default", - "introShelf.gradientOut": null -} \ No newline at end of file diff --git a/data/colors_v2/index.ts b/data/colors_v2/index.ts deleted file mode 100644 index f19425b7a..000000000 --- a/data/colors_v2/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import light from './themes/light' -import dark from './themes/dark' -import dark_dimmed from './themes/dark_dimmed' -import dark_high_contrast from './themes/dark_high_contrast' - -export default { - light, - dark, - dark_dimmed, - dark_high_contrast -} diff --git a/data/colors_v2/prefix b/data/colors_v2/prefix deleted file mode 100644 index 9821353be..000000000 --- a/data/colors_v2/prefix +++ /dev/null @@ -1 +0,0 @@ -color diff --git a/data/colors_v2/themes/dark.ts b/data/colors_v2/themes/dark.ts deleted file mode 100644 index 402414541..000000000 --- a/data/colors_v2/themes/dark.ts +++ /dev/null @@ -1,66 +0,0 @@ -import {merge} from '../../../src/utils' -import darkComponentVars from '../vars/component_dark' -import deprecatedVars from '../vars/deprecated' -import darkGlobalVars from '../vars/global_dark' -import darkMarketingVars from '../vars/marketing_dark' -import darkAppVars from '../vars/app_dark' - -const scale = { - black: '#010409', - white: '#f0f6fc', - gray: ['#f0f6fc', '#c9d1d9', '#b1bac4', '#8b949e', '#6e7681', '#484f58', '#30363d', '#21262d', '#161b22', '#0d1117'], - blue: ['#cae8ff', '#a5d6ff', '#79c0ff', '#58a6ff', '#388bfd', '#1f6feb', '#1158c7', '#0d419d', '#0c2d6b', '#051d4d'], - green: ['#aff5b4', '#7ee787', '#56d364', '#3fb950', '#2ea043', '#238636', '#196c2e', '#0f5323', '#033a16', '#04260f'], - yellow: [ - '#f8e3a1', - '#f2cc60', - '#e3b341', - '#d29922', - '#bb8009', - '#9e6a03', - '#845306', - '#693e00', - '#4b2900', - '#341a00' - ], - orange: [ - '#ffdfb6', - '#ffc680', - '#ffa657', - '#f0883e', - '#db6d28', - '#bd561d', - '#9b4215', - '#762d0a', - '#5a1e02', - '#3d1300' - ], - red: ['#ffdcd7', '#ffc1ba', '#ffa198', '#ff7b72', '#f85149', '#da3633', '#b62324', '#8e1519', '#67060c', '#490202'], - purple: [ - '#eddeff', - '#e2c5ff', - '#d2a8ff', - '#bc8cff', - '#a371f7', - '#8957e5', - '#6e40c9', - '#553098', - '#3c1e70', - '#271052' - ], - pink: ['#ffdaec', '#ffbedd', '#ff9bce', '#f778ba', '#db61a2', '#bf4b8a', '#9e3670', '#7d2457', '#5e103e', '#42062a'], - coral: [ - '#FFDDD2', - '#FFC2B2', - '#FFA28B', - '#F78166', - '#EA6045', - '#CF462D', - '#AC3220', - '#872012', - '#640D04', - '#460701' - ] -} - -export default merge(deprecatedVars, darkAppVars, darkMarketingVars, darkComponentVars, darkGlobalVars, {scale}) diff --git a/data/colors_v2/themes/dark_dimmed.ts b/data/colors_v2/themes/dark_dimmed.ts deleted file mode 100644 index fc14cad02..000000000 --- a/data/colors_v2/themes/dark_dimmed.ts +++ /dev/null @@ -1,62 +0,0 @@ -import {merge} from '../../../src/utils' -import dark from './dark' - -const scale = { - black: '#1c2128', - white: '#cdd9e5', - gray: ['#cdd9e5', '#adbac7', '#909dab', '#768390', '#636e7b', '#545d68', '#444c56', '#373e47', '#2d333b', '#22272e'], - blue: ['#c6e6ff', '#96d0ff', '#6cb6ff', '#539bf5', '#4184e4', '#316dca', '#255ab2', '#1b4b91', '#143d79', '#0f2d5c'], - green: ['#b4f1b4', '#8ddb8c', '#6bc46d', '#57ab5a', '#46954a', '#347d39', '#2b6a30', '#245829', '#1b4721', '#113417'], - yellow: [ - '#fbe090', - '#eac55f', - '#daaa3f', - '#c69026', - '#ae7c14', - '#966600', - '#805400', - '#6c4400', - '#593600', - '#452700' - ], - orange: [ - '#ffddb0', - '#ffbc6f', - '#f69d50', - '#e0823d', - '#cc6b2c', - '#ae5622', - '#94471b', - '#7f3913', - '#682d0f', - '#4d210c' - ], - red: ['#ffd8d3', '#ffb8b0', '#ff938a', '#f47067', '#e5534b', '#c93c37', '#ad2e2c', '#922323', '#78191b', '#78191b'], - purple: [ - '#eedcff', - '#dcbdfb', - '#dcbdfb', - '#b083f0', - '#986ee2', - '#8256d0', - '#6b44bc', - '#5936a2', - '#472c82', - '#352160' - ], - pink: ['#ffd7eb', '#ffb3d8', '#fc8dc7', '#e275ad', '#c96198', '#ae4c82', '#983b6e', '#7e325a', '#69264a', '#551639'], - coral: [ - '#FFDACF', - '#FFB9A5', - '#F79981', - '#EC775C', - '#DE5B41', - '#C2442D', - '#A93524', - '#8D291B', - '#771D13', - '#5D1008' - ] -} - -export default merge(dark, {scale}) diff --git a/data/colors_v2/themes/dark_high_contrast.ts b/data/colors_v2/themes/dark_high_contrast.ts deleted file mode 100644 index 1951caa4d..000000000 --- a/data/colors_v2/themes/dark_high_contrast.ts +++ /dev/null @@ -1,203 +0,0 @@ -import {alpha, get, merge} from '../../../src/utils' -import dark from './dark' - -const scale = { - black: '#010409', - white: '#ffffff', - gray: [ - '#ffffff', - '#f0f3f6', - '#d9dee3', - '#bdc4cc', - '#9ea7b3', - '#7a828e', - '#525964', - '#272b33', - '#272b33', - '#0a0c10' - ], - blue: [ - '#caeaff', - '#addcff', - '#91cbff', - '#71b7ff', - '#409eff', - '#409eff', - '#318bf8', - '#2672f3', - '#1e60d5', - '#194fb1' - ], - green: [ - '#acf7b6', - '#72f088', - '#4ae168', - '#26cd4d', - '#09b43a', - '#09b43a', - '#02a232', - '#008c2c', - '#007728', - '#006222' - ], - yellow: [ - '#fbe59e', - '#fbd669', - '#f7c843', - '#f0b72f', - '#e09b13', - '#e09b13', - '#c88508', - '#ae7104', - '#945d02', - '#7b4900' - ], - orange: [ - '#ffe1b4', - '#ffcf86', - '#ffb757', - '#fe9a2d', - '#e7811d', - '#e7811d', - '#d57014', - '#bf5e0a', - '#a74c00', - '#8f3c00' - ], - red: [ - '#ffdedb', - '#ffc9c7', - '#ffb1af', - '#ff9492', - '#ff6a69', - '#ff6a69', - '#ff4445', - '#e82a2f', - '#cc1421', - '#ad0116' - ], - purple: [ - '#f0dfff', - '#e6ccff', - '#dbb7ff', - '#cb9eff', - '#b780ff', - '#b87fff', - '#a66bff', - '#954ffd', - '#8031f7', - '#6921d7' - ], - pink: [ - '#ffdceb', - '#ffc7e1', - '#ffadd4', - '#ff8dc7', - '#ef6eb1', - '#ef6eb1', - '#e456a3', - '#d23d91', - '#b72c7d', - '#9c1d6a' - ], - coral: [ - '#FFDED4', - '#FFCBB9', - '#FFB39B', - '#FF967D', - '#FC704F', - '#FC704F', - '#F75133', - '#E03B21', - '#C62612', - '#A91500' - ] -} - -const exceptions = { - fg: { - muted: get('scale.gray.1'), - onEmphasis: get('scale.gray.9') - }, - border: { - default: get('scale.gray.5'), - muted: get('scale.gray.5'), - subtle: get('scale.gray.5') - }, - neutral: { - emphasis: get('scale.gray.4'), - emphasisPlus: get('scale.gray.0') - }, - accent: { - muted: get('scale.blue.4'), - }, - success: { - muted: get('scale.green.4'), - }, - attention: { - muted: get('scale.yellow.4'), - }, - severe: { - muted: get('scale.orange.4'), - }, - danger: { - muted: get('scale.red.4'), - }, - done: { - muted: get('scale.purple.4'), - }, - sponsors: { - muted: get('scale.pink.4'), - }, - avatar: { - border: alpha(get('scale.white'), 0.9), - }, - diffstat: { - deletionBorder: get('scale.red.2'), - additionBorder: get('scale.green.2') - }, - underlinenav : { - icon: get('scale.gray.1'), - borderHover: get('scale.gray.3'), - }, - topicTag: { - border: get('accent.emphasis') - }, - btn: { - selectedBg: alpha(get('scale.gray.6'), 0.9), - primary: { - text: get('fg.onEmphasis'), - border: get('scale.green.2'), - hoverBg: get('scale.green.3'), - hoverBorder: get('scale.green.2'), - disabledText: alpha(get('fg.onEmphasis'), 0.5), - disabledBg: alpha(get('scale.green.5'), 0.6), - disabledBorder: alpha(get('scale.green.2'), 0.4), - icon: get('fg.onEmphasis'), - counterBg: alpha(get('scale.black'), 0.15) - }, - danger: { - hoverCounterBG: alpha(get('scale.black'), 0.15), - counterBg: alpha(get('scale.black'), 0.15) - } - }, - codemirror: { - selectionBg: alpha(get('scale.blue.4'), 0.4), - }, - diffBlob: { - addition: { - fg: get('fg.onEmphasis') - }, - deletion: { - fg: get('fg.onEmphasis'), - }, - expander: { - icon: get('fg.onEmphasis'), - }, - hunk: { - numBg: alpha(get('accent.muted'), 0.4), - }, - }, -} - -export default merge(dark, exceptions, {scale}) diff --git a/data/colors_v2/themes/light.ts b/data/colors_v2/themes/light.ts deleted file mode 100644 index 56cae05c4..000000000 --- a/data/colors_v2/themes/light.ts +++ /dev/null @@ -1,66 +0,0 @@ -import {merge} from '../../../src/utils' -import lightComponentVars from '../vars/component_light' -import deprecatedVars from '../vars/deprecated' -import lightGlobalVars from '../vars/global_light' -import lightMarketingVars from '../vars/marketing_light' -import lightAppVars from '../vars/app_light' - -const scale = { - black: '#1b1f24', - white: '#ffffff', - gray: ['#f6f8fa', '#eaeef2', '#d0d7de', '#afb8c1', '#8c959f', '#6e7781', '#57606a', '#424a53', '#32383f', '#24292f'], - blue: ['#ddf4ff', '#b6e3ff', '#80ccff', '#54aeff', '#218bff', '#0969da', '#0550ae', '#033d8b', '#0a3069', '#002155'], - green: ['#dafbe1', '#aceebb', '#6fdd8b', '#4ac26b', '#2da44e', '#1a7f37', '#116329', '#044f1e', '#003d16', '#002d11'], - yellow: [ - '#fff8c5', - '#fae17d', - '#eac54f', - '#d4a72c', - '#bf8700', - '#9a6700', - '#7d4e00', - '#633c01', - '#4d2d00', - '#3b2300' - ], - orange: [ - '#fff1e5', - '#ffd8b5', - '#ffb77c', - '#fb8f44', - '#e16f24', - '#bc4c00', - '#953800', - '#762c00', - '#5c2200', - '#471700' - ], - red: ['#FFEBE9', '#ffcecb', '#ffaba8', '#ff8182', '#fa4549', '#cf222e', '#a40e26', '#82071e', '#660018', '#4c0014'], - purple: [ - '#fbefff', - '#ecd8ff', - '#d8b9ff', - '#c297ff', - '#a475f9', - '#8250df', - '#6639ba', - '#512a97', - '#3e1f79', - '#2e1461' - ], - pink: ['#ffeff7', '#ffd3eb', '#ffadda', '#ff80c8', '#e85aad', '#bf3989', '#99286e', '#772057', '#611347', '#4d0336'], - coral: [ - '#FFF0EB', - '#FFD6CC', - '#FFB4A1', - '#FD8C73', - '#EC6547', - '#C4432B', - '#9E2F1C', - '#801F0F', - '#691105', - '#510901' - ] -} - -export default merge(deprecatedVars, lightAppVars, lightMarketingVars, lightComponentVars, lightGlobalVars, {scale}) diff --git a/data/colors_v2/vars/app_dark.ts b/data/colors_v2/vars/app_dark.ts deleted file mode 100644 index 36d8cef22..000000000 --- a/data/colors_v2/vars/app_dark.ts +++ /dev/null @@ -1,171 +0,0 @@ -import {get, alpha} from '../../../src/utils' - -// Variables to be moved to github/github - -export default { - marketingIcon: { - primary: get('scale.blue.2'), - secondary: get('scale.blue.5') - }, - diffBlob: { - addition: { - numText: get('fg.default'), - fg: get('fg.default'), - numBg: alpha(get('scale.green.3'), 0.3), - lineBg: get('success.subtle'), - wordBg: get('success.muted'), - }, - deletion: { - numText: get('fg.default'), - fg: get('fg.default'), - numBg: alpha(get('scale.red.4'), 0.3), - }, - expander: { - icon: get('fg.muted'), - }, - selectedLineHighlightMixBlendMode: 'screen' - }, - searchKeyword: { - hl: alpha(get('scale.yellow.3'), 0.4), - }, - prettylights: { - syntax: { - comment: get('scale.gray.3'), - constant: get('scale.blue.2'), - entity: get('scale.purple.2'), - storageModifierImport: get('scale.gray.1'), - entityTag: get('scale.green.1'), - keyword: get('scale.red.3'), - string: get('scale.blue.1'), - variable: get('scale.orange.2'), - brackethighlighterUnmatched: get('scale.red.4'), - invalidIllegalText: get('scale.gray.0'), - invalidIllegalBg: get('scale.red.7'), - carriageReturnText: get('scale.gray.0'), - carriageReturnBg: get('scale.red.6'), - stringRegexp: get('scale.green.1'), - markupList: get('scale.yellow.1'), - markupHeading: get('scale.blue.5'), - markupItalic: get('scale.gray.1'), - markupBold: get('scale.gray.1'), - markupDeletedText: get('scale.red.0'), - markupDeletedBg: get('scale.red.8'), - markupInsertedText: get('scale.green.0'), - markupInsertedBg: get('scale.green.8'), - markupChangedText: get('scale.orange.0'), - markupChangedBg: get('scale.orange.8'), - markupIgnoredText: get('scale.gray.1'), - markupIgnoredBg: get('scale.blue.6'), - metaDiffRange: get('scale.purple.2'), - brackethighlighterAngle: get('scale.gray.3'), - sublimelinterGutterMark: get('scale.gray.5'), - constantOtherReferenceLink: get('scale.blue.1') - } - }, - codemirror: { - text: get('fg.default'), - bg: get('canvas.default'), - guttersBg: get('canvas.default'), - guttermarkerText: get('canvas.default'), - guttermarkerSubtleText: get('fg.subtle'), - linenumberText: get('fg.muted'), - cursor: get('fg.default'), - selectionBg: get('accent.muted'), - activelineBg: get('neutral.subtle'), - matchingbracketText: get('fg.default'), - linesBg: get('canvas.default'), - syntax: { - comment: get('scale.gray.3'), - constant: get('scale.blue.2'), - entity: get('scale.purple.2'), - keyword: get('scale.red.3'), - storage: get('scale.red.3'), - string: get('scale.blue.1'), - support: get('scale.blue.2'), - variable: get('scale.orange.2') - } - }, - checks: { - bg: get('canvas.inset'), - runBorderWidth: '1px', - containerBorderWidth: '1px', - textPrimary: get('fg.default'), - textSecondary: get('fg.muted'), - textLink: get('accent.fg'), - btnIcon: get('fg.muted'), - btnHoverIcon: get('fg.default'), - btnHoverBg: get('neutral.subtle'), - inputText: get('fg.muted'), - inputPlaceholderText: get('fg.subtle'), - inputFocusText: get('fg.default'), - inputBg: get('scale.gray.8'), - inputShadow: (theme: any) => `0 0 0 1px ${get('border.default')(theme)}`, - donutError: get('scale.red.4'), - donutPending: get('scale.yellow.3'), - donutSuccess: get('scale.green.4'), - donutNeutral: get('scale.gray.3'), - dropdownText: get('fg.default'), - dropdownBg: get('canvas.overlay'), - dropdownBorder: get('border.default'), - dropdownShadow: alpha(get('scale.black'), 0.3), - dropdownHoverText: get('fg.default'), - dropdownHoverBg: get('neutral.subtle'), - dropdownBtnHoverText: get('fg.default'), - dropdownBtnHoverBg: get('neutral.subtle'), - scrollbarThumbBg: get('neutral.muted'), - headerLabelText: get('fg.muted'), - headerLabelOpenText: get('fg.default'), - headerBorder: get('border.muted'), - headerIcon: get('fg.muted'), - lineText: get('fg.muted'), - lineNumText: get('fg.subtle'), - lineTimestampText: get('fg.subtle'), - lineHoverBg: get('neutral.subtle'), - lineSelectedBg: get('accent.subtle'), - lineSelectedNumText: get('accent.fg'), - lineDtFmText: get('fg.onEmphasis'), - lineDtFmBg: get('attention.emphasis'), - gateBg: get('attention.subtle'), - gateText: get('fg.muted'), - gateWaitingText: get('attention.fg'), - stepHeaderOpenBg: get('canvas.subtle'), - stepErrorText: get('danger.fg'), - stepWarningText: get('attention.fg'), - loglineText: get('fg.muted'), - loglineNumText: get('fg.subtle'), - loglineDebugText: get('done.fg'), - loglineErrorText: get('fg.muted'), - loglineErrorNumText: get('fg.subtle'), - loglineErrorBg: get('danger.subtle'), - loglineWarningText: get('fg.muted'), - loglineWarningNumText: get('attention.fg'), - loglineWarningBg: get('attention.subtle'), - loglineCommandText: get('accent.fg'), - loglineSectionText: get('success.fg'), - ansi: { - black: get('scale.gray.9'), - blackBright: get('scale.gray.8'), - white: get('scale.gray.2'), - whiteBright: get('scale.gray.2'), - gray: get('scale.gray.4'), - red: get('scale.red.3'), - redBright: get('scale.red.2'), - green: get('scale.green.3'), - greenBright: get('scale.green.2'), - yellow: get('scale.yellow.3'), - yellowBright: get('scale.yellow.2'), - blue: get('scale.blue.3'), - blueBright: get('scale.blue.2'), - magenta: get('scale.purple.3'), - magentaBright: get('scale.purple.2'), - cyan: '#76e3ea', - cyanBright: '#b3f0ff' - } - }, - project: { - headerBg: get('scale.gray.9'), - sidebarBg: get('scale.gray.8'), - gradientIn: get('scale.gray.8'), - gradientOut: alpha(get('scale.gray.8'), 0) - } -} diff --git a/data/colors_v2/vars/app_light.ts b/data/colors_v2/vars/app_light.ts deleted file mode 100644 index 692ff2676..000000000 --- a/data/colors_v2/vars/app_light.ts +++ /dev/null @@ -1,171 +0,0 @@ -import {alpha, get} from '../../../src/utils' - -// Variables to be moved to github/github - -export default { - marketingIcon: { - primary: get('scale.blue.4'), - secondary: get('scale.blue.3') - }, - diffBlob: { - addition: { - numText: get('fg.default'), - fg: get('fg.default'), - numBg: '#CCFFD8', - lineBg: '#E6FFEC', - wordBg: '#ABF2BC', - }, - deletion: { - numText: get('fg.default'), - fg: get('fg.default'), - numBg: '#FFD7D5', - }, - expander: { - icon: get('fg.muted'), - }, - selectedLineHighlightMixBlendMode: 'multiply' - }, - searchKeyword: { - hl: get('scale.yellow.0'), - }, - prettylights: { - syntax: { - comment: get('scale.gray.5'), - constant: get('scale.blue.6'), - entity: get('scale.purple.5'), - storageModifierImport: get('scale.gray.9'), - entityTag: get('scale.green.6'), - keyword: get('scale.red.5'), - string: get('scale.blue.8'), - variable: get('scale.orange.6'), - brackethighlighterUnmatched: get('scale.red.7'), - invalidIllegalText: get('scale.gray.0'), - invalidIllegalBg: get('scale.red.7'), - carriageReturnText: get('scale.gray.0'), - carriageReturnBg: get('scale.red.5'), - stringRegexp: get('scale.green.6'), - markupList: get('scale.yellow.9'), - markupHeading: get('scale.blue.6'), - markupItalic: get('scale.gray.9'), - markupBold: get('scale.gray.9'), - markupDeletedText: get('scale.red.7'), - markupDeletedBg: get('scale.red.0'), - markupInsertedText: get('scale.green.6'), - markupInsertedBg: get('scale.green.0'), - markupChangedText: get('scale.orange.6'), - markupChangedBg: get('scale.orange.1'), - markupIgnoredText: get('scale.gray.1'), - markupIgnoredBg: get('scale.blue.6'), - metaDiffRange: get('scale.purple.5'), - brackethighlighterAngle: get('scale.gray.6'), - sublimelinterGutterMark: get('scale.gray.4'), - constantOtherReferenceLink: get('scale.blue.8') - } - }, - codemirror: { - text: get('fg.default'), - bg: get('canvas.default'), - guttersBg: get('canvas.default'), - guttermarkerText: get('canvas.default'), - guttermarkerSubtleText: get('fg.subtle'), - linenumberText: get('fg.muted'), - cursor: get('fg.default'), - selectionBg: get('accent.muted'), - activelineBg: get('neutral.subtle'), - matchingbracketText: get('fg.default'), - linesBg: get('canvas.default'), - syntax: { - comment: get('scale.gray.9'), - constant: get('scale.blue.6'), - entity: get('scale.purple.5'), - keyword: get('scale.red.5'), - storage: get('scale.red.5'), - string: get('scale.blue.8'), - support: get('scale.blue.6'), - variable: get('scale.orange.6') - } - }, - checks: { - bg: get('scale.gray.9'), - runBorderWidth: '0px', - containerBorderWidth: '0px', - textPrimary: get('scale.gray.0'), - textSecondary: get('scale.gray.4'), - textLink: get('scale.blue.3'), - btnIcon: get('scale.gray.3'), - btnHoverIcon: get('scale.gray.0'), - btnHoverBg: 'rgba(255,255,255,0.125)', - inputText: get('scale.gray.1'), - inputPlaceholderText: get('scale.gray.4'), - inputFocusText: get('scale.gray.4'), - inputBg: get('scale.gray.8'), - inputShadow: 'none', - donutError: get('scale.red.4'), - donutPending: get('scale.yellow.4'), - donutSuccess: get('scale.green.4'), - donutNeutral: get('scale.gray.3'), - dropdownText: get('scale.gray.3'), - dropdownBg: get('scale.gray.8'), - dropdownBorder: get('scale.gray.7'), - dropdownShadow: alpha(get('scale.black'), 0.3), - dropdownHoverText: get('scale.gray.0'), - dropdownHoverBg: get('scale.gray.7'), - dropdownBtnHoverText: get('scale.gray.0'), - dropdownBtnHoverBg: get('scale.gray.8'), - scrollbarThumbBg: get('scale.gray.6'), - headerLabelText: get('scale.gray.2'), - headerLabelOpenText: get('scale.gray.0'), - headerBorder: get('scale.gray.8'), - headerIcon: get('scale.gray.4'), - lineText: get('scale.gray.2'), - lineNumText: alpha(get('scale.gray.4'), 0.75), - lineTimestampText: get('scale.gray.4'), - lineHoverBg: get('scale.gray.8'), - lineSelectedBg: alpha(get('scale.blue.4'), 0.15), - lineSelectedNumText: get('scale.blue.3'), - lineDtFmText: get('scale.gray.9'), - lineDtFmBg: get('scale.yellow.5'), - gateBg: alpha(get('scale.yellow.6'), 0.15), - gateText: get('scale.gray.2'), - gateWaitingText: get('scale.gray.3'), - stepHeaderOpenBg: get('scale.gray.8'), - stepErrorText: get('scale.red.3'), - stepWarningText: get('scale.yellow.3'), - loglineText: get('scale.gray.4'), - loglineNumText: alpha(get('scale.gray.4'), 0.75), - loglineDebugText: get('scale.purple.3'), - loglineErrorText: get('scale.gray.2'), - loglineErrorNumText: get('scale.red.3'), - loglineErrorBg: alpha(get('scale.red.6'), 0.15), - loglineWarningText: get('scale.gray.2'), - loglineWarningNumText: get('scale.yellow.3'), - loglineWarningBg: alpha(get('scale.yellow.6'), 0.15), - loglineCommandText: get('scale.blue.3'), - loglineSectionText: get('scale.green.3'), - ansi: { - black: get('scale.gray.9'), - blackBright: get('scale.gray.8'), - white: get('scale.gray.2'), - whiteBright: get('scale.gray.2'), - gray: get('scale.gray.4'), - red: get('scale.red.3'), - redBright: get('scale.red.2'), - green: get('scale.green.3'), - greenBright: get('scale.green.2'), - yellow: get('scale.yellow.3'), - yellowBright: get('scale.yellow.2'), - blue: get('scale.blue.3'), - blueBright: get('scale.blue.2'), - magenta: get('scale.purple.3'), - magentaBright: get('scale.purple.2'), - cyan: '#76e3ea', - cyanBright: '#b3f0ff' - } - }, - project: { - headerBg: get('scale.gray.9'), - sidebarBg: get('scale.white'), - gradientIn: get('scale.white'), - gradientOut: alpha(get('scale.white'), 0) - } -} diff --git a/data/colors_v2/vars/component_dark.ts b/data/colors_v2/vars/component_dark.ts deleted file mode 100644 index 4a61f8812..000000000 --- a/data/colors_v2/vars/component_dark.ts +++ /dev/null @@ -1,146 +0,0 @@ -import {alpha, darken, get} from '../../../src/utils' - -export default { - avatar: { - bg: alpha(get('scale.white'), 0.1), - border: get('border.subtle'), - stackFade: get('scale.gray.6'), - stackFadeMore: get('scale.gray.7'), - childShadow: (theme: any) => `-2px -2px 0 ${get('scale.gray.9')(theme)}` - }, - - topicTag: { - border: 'transparent' - }, - selectMenu: { - backdropBorder: get('scale.gray.5'), - tapHighlight: alpha(get('scale.gray.6'), 0.5), - tapFocusBg: get('scale.blue.8') - }, - overlay: { - shadow: (theme: any) => `0 0 0 1px ${get('scale.gray.6')(theme)}, 0 16px 32px ${alpha(get('scale.black'), 0.85)(theme)}`, - }, - header: { - text: alpha(get('scale.white'), 0.7), - bg: get('scale.gray.8'), - logo: get('scale.gray.0'), - }, - headerSearch: { - bg: get('scale.gray.9'), - border: get('scale.gray.6') - }, - sidenav: { - selectedBg: get('scale.gray.7') - }, - menu: { - bgActive: get('scale.gray.8') - }, - input: { - disabledBg: alpha(get('neutral.muted'), 0.5) - }, - diffstat: { - additionBg: get('scale.green.3') - }, - timeline: { - badgeBg: get('scale.gray.7') // needs to be opaque - }, - ansi: { - black: get('scale.gray.5'), - blackBright: get('scale.gray.4'), - white: get('scale.gray.2'), - whiteBright: get('scale.white'), - gray: get('scale.gray.4'), - red: get('scale.red.3'), - redBright: get('scale.red.2'), - green: get('scale.green.3'), - greenBright: get('scale.green.2'), - yellow: get('scale.yellow.3'), - yellowBright: get('scale.yellow.2'), - blue: get('scale.blue.3'), - blueBright: get('scale.blue.2'), - magenta: get('scale.purple.3'), - magentaBright: get('scale.purple.2'), - cyan: '#39c5cf', - cyanBright: '#56d4dd' - }, - btn: { - text: get('scale.gray.1'), - bg: get('scale.gray.7'), - border: get('border.subtle'), - shadow: '0 0 transparent', - insetShadow: '0 0 transparent', - hoverBg: get('scale.gray.6'), - hoverBorder: get('scale.gray.3'), - activeBg: darken(get('scale.gray.6'), 0.03), - activeBorder: get('scale.gray.4'), - selectedBg: get('scale.gray.8'), - focusBg: get('scale.gray.7'), - focusBorder: get('scale.gray.3'), - focusShadow: (theme: any) => `0 0 0 3px ${alpha(get('scale.gray.3'), 0.3)(theme)}`, - shadowActive: (theme: any) => `inset 0 0.15em 0.3em ${alpha(get('scale.black'), 0.15)(theme)}`, - shadowInputFocus: (theme: any) => `0 0 0 0.2em ${alpha(get('scale.blue.5'), 0.3)(theme)}`, - counterBg: get('scale.gray.6'), - - primary: { - text: '#ffffff', - bg: get('scale.green.5'), - border: get('border.subtle'), - shadow: '0 0 transparent', - insetShadow: '0 0 transparent', - hoverBg: get('scale.green.4'), - hoverBorder: get('border.subtle'), - selectedBg: get('scale.green.5'), - selectedShadow: '0 0 transparent', - disabledText: alpha(get('scale.white'), 0.5), - disabledBg: alpha(get('scale.green.5'), 0.6), - disabledBorder: get('border.subtle'), - focusBg: get('scale.green.5'), - focusBorder: get('border.subtle'), - focusShadow: (theme: any) => `0 0 0 3px ${alpha('#2ea44f', 0.4)(theme)}`, - icon: get('scale.white'), - counterBg: alpha(get('scale.white'), 0.2) - }, - - outline: { - text: get('scale.blue.3'), - hoverText: get('scale.blue.3'), - hoverBg: get('scale.gray.6'), - hoverBorder: get('border.subtle'), - hoverShadow: (theme: any) => `0 1px 0 ${alpha(get('scale.black'), 0.1)(theme)}`, - hoverInsetShadow: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.white'), 0.03)(theme)}`, - hoverCounterBg: alpha(get('scale.white'), 0.2), - selectedText: get('scale.white'), - selectedBg: get('scale.blue.7'), - selectedBorder: get('border.subtle'), - selectedShadow: '0 0 transparent', - disabledText: alpha(get('scale.blue.3'), 0.5), - disabledBg: get('scale.gray.9'), - disabledCounterBg: alpha(get('scale.blue.5'), 0.05), - focusBorder: get('border.subtle'), - focusShadow: (theme: any) => `0 0 0 3px ${alpha(get('scale.blue.6'), 0.4)(theme)}`, - counterBg: alpha(get('scale.blue.5'), 0.1) - }, - - danger: { - text: get('scale.red.4'), - hoverText: get('fg.onEmphasis'), - hoverBg: get('scale.red.5'), - hoverBorder: get('scale.red.4'), - hoverShadow: '0 0 transparent', - hoverInsetShadow: '0 0 transparent', - hoverIcon: get('fg.onEmphasis'), - hoverCounterBg: alpha('#fff', 0.2), - selectedText: '#ffffff', - selectedBg: get('scale.red.6'), - selectedBorder: get('scale.red.3'), - selectedShadow: '0 0 transparent', - disabledText: alpha(get('scale.red.4'), 0.5), - disabledBg: get('scale.gray.9'), - disabledCounterBg: alpha(get('scale.red.5'), 0.05), - focusBorder: get('scale.red.4'), - focusShadow: (theme: any) => `0 0 0 3px ${alpha(get('scale.red.4'), 0.4)(theme)}`, - counterBg: alpha(get('scale.red.5'), 0.1), - icon: get('scale.red.4') - } - } -} diff --git a/data/colors_v2/vars/component_light.ts b/data/colors_v2/vars/component_light.ts deleted file mode 100644 index 655f5aeca..000000000 --- a/data/colors_v2/vars/component_light.ts +++ /dev/null @@ -1,147 +0,0 @@ -import {alpha, darken, get} from '../../../src/utils' - -export default { - avatar: { - bg: get('scale.white'), - border: get('border.subtle'), - stackFade: get('scale.gray.3'), - stackFadeMore: get('scale.gray.2'), - childShadow: (theme: any) => `-2px -2px 0 ${alpha(get('scale.white'), 0.8)(theme)}` - }, - - topicTag: { - border: 'transparent' - }, - selectMenu: { - backdropBorder: 'transparent', - tapHighlight: alpha(get('scale.gray.3'), 0.5), - tapFocusBg: get('scale.blue.1') - }, - overlay: { - shadow: (theme: any) => `0 1px 3px ${alpha(get('scale.black'), 0.12)(theme)}, 0 8px 24px ${alpha(get('scale.gray.7'), 0.12)(theme)}`, - }, - header: { - text: alpha(get('scale.white'), 0.7), - bg: get('scale.gray.9'), - logo: get('scale.white'), - }, - headerSearch: { - bg: get('scale.gray.9'), - border: get('scale.gray.6') - }, - sidenav: { - selectedBg: get('scale.white') - }, - menu: { - bgActive: 'transparent' - }, - input: { - disabledBg: get('neutral.muted') - }, - diffstat: { - additionBg: get('scale.green.4') - }, - timeline: { - badgeBg: get('scale.gray.1') // needs to be opaque - }, - ansi: { - black: get('scale.gray.9'), - blackBright: get('scale.gray.6'), - white: get('scale.gray.5'), - whiteBright: get('scale.gray.4'), - gray: get('scale.gray.5'), - red: get('scale.red.5'), - redBright: get('scale.red.6'), - green: get('scale.green.6'), - greenBright: get('scale.green.5'), - yellow: get('scale.yellow.8'), - yellowBright: get('scale.yellow.7'), - blue: get('scale.blue.5'), - blueBright: get('scale.blue.4'), - magenta: get('scale.purple.5'), - magentaBright: get('scale.purple.4'), - cyan: '#1b7c83', - cyanBright: '#3192aa' - }, - // Do we need all these btn variables? - btn: { - text: get('scale.gray.9'), - bg: get('scale.gray.0'), - border: get('border.subtle'), - shadow: (theme: any) => `0 1px 0 ${alpha(get('scale.black'), 0.04)(theme)}`, - insetShadow: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.white'), 0.25)(theme)}`, - hoverBg: '#f3f4f6', - hoverBorder: get('border.subtle'), - activeBg: darken(get('btn.hoverBg'), 0.03), - activeBorder: get('border.subtle'), - selectedBg: darken(get('btn.hoverBg'), 0.02), - focusBg: get('scale.gray.0'), - focusBorder: get('border.subtle'), - focusShadow: (theme: any) => `0 0 0 3px ${alpha(get('scale.blue.5'), 0.3)(theme)}`, - shadowActive: (theme: any) => `inset 0 0.15em 0.3em ${alpha(get('scale.black'), 0.15)(theme)}`, // TODO: Deprecate? Not used in Primer CSS - shadowInputFocus: (theme: any) => `0 0 0 0.2em ${alpha(get('scale.blue.5'), 0.3)(theme)}`, // TODO: Deprecate? - counterBg: alpha(get('scale.black'), 0.08), - - primary: { - text: get('scale.white'), - bg: get('scale.green.4'), - border: get('border.subtle'), - shadow: (theme: any) => `0 1px 0 ${alpha(get('scale.black'), 0.1)(theme)}`, - insetShadow: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.white'), 0.03)(theme)}`, - hoverBg: '#2c974b', - hoverBorder: get('border.subtle'), - selectedBg: darken(get('btn.primary.hoverBg'), 0.02), - selectedShadow: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.green.9'), 0.2)(theme)}`, - disabledText: alpha(get('scale.white'), 0.8), - disabledBg: '#94d3a2', - disabledBorder: get('border.subtle'), - focusBg: get('scale.green.4'), - focusBorder: get('border.subtle'), - focusShadow: (theme: any) => `0 0 0 3px ${alpha(get('btn.primary.focusBg'), 0.4)(theme)}`, - icon: alpha(get('scale.white'), 0.8), - counterBg: alpha(get('scale.white'), 0.2) - }, - - outline: { - text: get('scale.blue.5'), - hoverText: get('scale.white'), - hoverBg: get('scale.blue.5'), - hoverBorder: get('border.subtle'), - hoverShadow: (theme: any) => `0 1px 0 ${alpha(get('scale.black'), 0.1)(theme)}`, - hoverInsetShadow: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.white'), 0.03)(theme)}`, - hoverCounterBg: alpha(get('scale.white'), 0.2), - selectedText: get('scale.white'), - selectedBg: darken(get('scale.blue.5'), 0.03), - selectedBorder: get('border.subtle'), - selectedShadow: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.blue.9'), 0.2)(theme)}`, - disabledText: alpha(get('scale.blue.5'), 0.5), - disabledBg: get('scale.gray.0'), - disabledCounterBg: alpha(get('scale.blue.5'), 0.05), - focusBorder: get('border.subtle'), - focusShadow: (theme: any) => `0 0 0 3px ${alpha(get('scale.blue.6'), 0.4)(theme)}`, - counterBg: alpha(get('scale.blue.5'), 0.1) - }, - - danger: { - text: get('scale.red.5'), - hoverText: get('scale.white'), - hoverBg: get('scale.red.6'), - hoverBorder: get('border.subtle'), - hoverShadow: (theme: any) => `0 1px 0 ${alpha(get('scale.black'), 0.1)(theme)}`, - hoverInsetShadow: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.white'), 0.03)(theme)}`, - hoverCounterBg: alpha(get('scale.white'), 0.2), - selectedText: get('scale.white'), - selectedBg: darken(get('scale.red.5'), 0.03), - selectedBorder: get('border.subtle'), - selectedShadow: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.red.9'), 0.2)(theme)}`, - disabledText: alpha(get('scale.red.5'), 0.5), - disabledBg: get('scale.gray.0'), - disabledCounterBg: alpha(get('scale.red.5'), 0.05), - focusBorder: get('border.subtle'), - focusShadow: (theme: any) => `0 0 0 3px ${alpha(get('scale.red.6'), 0.4)(theme)}`, - counterBg: alpha(get('scale.red.5'), 0.1), - icon: get('scale.red.5'), - hoverIcon: get('scale.white') - } - } -} diff --git a/data/colors_v2/vars/deprecated.ts b/data/colors_v2/vars/deprecated.ts deleted file mode 100644 index 1c72019d0..000000000 --- a/data/colors_v2/vars/deprecated.ts +++ /dev/null @@ -1,589 +0,0 @@ -import {alpha, get} from '../../../src/utils' - -// Variables to be removed in the next major release - -// Every variable in this file must map to a functional variable (e.g. get('fg.default')). -// Don't use hex codes (e.g. '#fff') or scale variables (e.g. get('scale.gray.5')). - -const deprecated = '#ff0000' -const unset = 'transparent' - -export default { - auto: { - black: deprecated, - white: deprecated, - gray: [ - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated - ], - blue: [ - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated - ], - green: [ - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated - ], - yellow: [ - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated - ], - orange: [ - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated - ], - red: [ - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated - ], - purple: [ - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated - ], - pink: [ - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated, - deprecated - ] - }, - text: { - primary: get('fg.default'), - secondary: get('fg.muted'), - tertiary: get('fg.muted'), - placeholder: get('fg.subtle'), - disabled: get('fg.muted'), - inverse: get('fg.onEmphasis'), - link: get('accent.fg'), - danger: get('danger.fg'), - success: get('success.fg'), - warning: get('attention.fg'), - white: deprecated, - }, - icon: { - primary: get('fg.default'), - secondary: get('fg.muted'), - tertiary: get('fg.muted'), - info: get('accent.fg'), - danger: get('danger.fg'), - success: get('success.fg'), - warning: get('attention.fg') - }, - border: { - primary: get('border.default'), - secondary: get('border.muted'), - tertiary: get('neutral.muted'), - overlay: get('border.default'), - inverse: get('fg.onEmphasis'), // or move to marketing - info: get('accent.emphasis'), - danger: get('danger.emphasis'), - success: get('success.emphasis'), - warning: get('attention.emphasis') - }, - bg: { - canvas: get('canvas.default'), - canvasMobile: unset, - canvasInverse: get('neutral.emphasis'), - canvasInset: get('canvas.inset'), - primary: get('canvas.default'), - secondary: get('canvas.subtle'), - tertiary: get('canvas.subtle'), - overlay: get('canvas.overlay'), - backdrop: get('primer.canvas.backdrop'), - info: get('accent.subtle'), - infoInverse: get('accent.emphasis'), - danger: get('danger.subtle'), - dangerInverse: get('danger.emphasis'), - success: get('success.subtle'), - successInverse: get('success.emphasis'), - warning: get('attention.subtle'), - warningInverse: get('attention.emphasis') - }, - shadow: { - highlight: get('primer.shadow.highlight'), - inset: get('primer.shadow.inset') - }, - state: { - hover: { - primaryBg: get('accent.emphasis'), - primaryBorder: get('accent.emphasis'), - primaryText: get('fg.onEmphasis'), - primaryIcon: get('fg.onEmphasis'), - secondaryBg: get('neutral.subtle'), - secondaryBorder: get('neutral.subtle') - }, - - selected: { - primaryBg: get('accent.emphasis'), - primaryBorder: get('accent.emphasis'), - primaryText: get('fg.onEmphasis'), - primaryIcon: get('fg.onEmphasis') - }, - - focus: { - border: get('accent.emphasis'), - shadow: get('primer.shadow.focus') // blue focus ring - } - }, - fade: { - fg10: deprecated, - fg15: deprecated, - fg30: deprecated, - fg50: deprecated, - fg70: deprecated, - fg85: deprecated, - black10: deprecated, - black15: deprecated, - black30: deprecated, - black50: deprecated, - black70: deprecated, - black85: deprecated, - white10: deprecated, - white15: deprecated, - white30: deprecated, - white50: deprecated, - white70: deprecated, - white85: deprecated - }, - alert: { - info: { - text: get('fg.default'), - icon: get('accent.fg'), - bg: get('accent.subtle'), - border: get('accent.muted') - }, - warn: { - text: get('fg.default'), - icon: get('attention.fg'), - bg: get('attention.subtle'), - border: get('attention.muted') - }, - error: { - text: get('fg.default'), - icon: get('danger.fg'), - bg: get('danger.subtle'), - border: get('danger.muted') - }, - success: { - text: get('fg.default'), - icon: get('success.fg'), - bg: get('success.subtle'), - border: get('success.muted') - } - }, - - autocomplete: { - shadow: get('shadow.medium'), - rowBorder: get('border.muted') - }, - blankslate: { - icon: get('fg.muted') - }, - counter: { - text: get('fg.default'), - bg: get('neutral.muted'), - primary: { - text: get('fg.onEmphasis'), - bg: get('neutral.emphasis') - }, - secondary: { - text: get('fg.muted'), - bg: get('neutral.subtle') - } - }, - box: { - blueBorder: get('accent.muted'), - rowYellowBg: get('attention.subtle'), - rowBlueBg: get('accent.subtle'), - headerBlueBg: get('accent.subtle'), - headerBlueBorder: get('accent.muted'), - borderInfo: get('accent.muted'), - bgInfo: get('accent.subtle'), - borderWarning: get('attention.muted'), - bgWarning: get('attention.subtle') - }, - branchName: { - text: get('fg.muted'), - icon: get('fg.muted'), - bg: get('accent.subtle'), - link: { - text: get('accent.fg'), - icon: get('accent.fg'), - bg: get('accent.subtle') - } - }, - - markdown: { - codeBg: get('neutral.muted'), - frameBorder: get('border.default'), - blockquoteBorder: get('border.default'), - tableBorder: get('border.default'), - tableTrBorder: get('border.muted') - }, - filterItem: { - barBg: get('neutral.subtle') - }, - hiddenTextExpander: { - bg: get('neutral.muted'), - bgHover: get('accent.muted') - }, - dragAndDrop: { - border: get('border.default') - }, - uploadEnabled: { - border: get('border.default'), - borderFocused: get('accent.emphasis') - }, - previewableCommentForm: { - border: get('border.default') - }, - verifiedBadge: { - text: get('success.fg'), - bg: get('canvas.default'), - border: get('border.default') - }, - socialCount: { - bg: get('canvas.default') - }, - tooltip: { - text: get('fg.onEmphasis'), - bg: get('neutral.emphasisPlus') - }, - filesExplorerIcon: get('accent.fg'), - hlAuthorBg: get('accent.subtle'), - hlAuthorBorder: get('accent.muted'), - logoSubdued: get('neutral.muted'), - discussionBorder: get('success.muted'), - discussionBgSuccess: get('success.emphasis'), - actionsWorkflowTableStickyBg: get('primer.canvas.sticky'), - repoLanguageColorBorder: get('primer.border.contrast'), - codeSelectionBg: get('accent.muted'), - highlight: { - text: get('fg.default'), - bg: get('attention.subtle') - }, - blob: { - lineHighlightBg: get('attention.subtle'), - lineHighlightBorder: get('attention.muted') - }, - topicTag: { - text: get('accent.fg'), - bg: get('accent.subtle'), - hoverBg: get('accent.emphasis'), - activeBg: get('accent.subtle') - }, - footerInvertocat: { - octicon: get('fg.subtle'), - octiconHover: get('fg.muted') - }, - dropdown: { - shadow: get('shadow.large') - }, - label: { - border: get('border.default'), - primary: { - text: get('fg.default'), - border: get('neutral.emphasis') - }, - secondary: { - text: get('fg.muted'), - border: get('border.default') - }, - info: { - text: get('accent.fg'), - border: get('accent.emphasis') - }, - success: { - text: get('success.fg'), - border: get('success.emphasis') - }, - warning: { - text: get('attention.fg'), - border: get('attention.emphasis') - }, - danger: { - text: get('danger.fg'), - border: get('danger.emphasis') - }, - orange: { - text: get('severe.fg'), - border: get('severe.emphasis') - } - }, - input: { - bg: get('canvas.default'), - contrastBg: get('canvas.inset'), - border: get('border.default'), - shadow: get('primer.shadow.inset'), - disabledBorder: get('border.default'), - warningBorder: get('attention.emphasis'), - errorBorder: get('danger.emphasis'), - tooltip: { - success: { - text: get('fg.default'), - bg: get('success.subtle'), - border: get('success.muted') - }, - warning: { - text: get('fg.default'), - bg: get('attention.subtle'), - border: get('attention.muted') - }, - error: { - text: get('fg.default'), - bg: get('danger.subtle'), - border: get('danger.muted') - } - } - }, - toast: { - text: get('fg.default'), - bg: get('canvas.default'), - border: get('border.default'), - shadow: get('shadow.large'), - icon: get('fg.onEmphasis'), - iconBg: get('accent.emphasis'), - iconBorder: unset, - success: { - text: get('fg.default'), - border: get('border.default'), - icon: get('fg.onEmphasis'), - iconBg: get('success.emphasis'), - iconBorder: unset - }, - warning: { - text: get('fg.default'), - border: get('border.default'), - icon: get('fg.default'), - iconBg: get('attention.emphasis'), - iconBorder: unset - }, - danger: { - text: get('fg.default'), - border: get('border.default'), - icon: get('fg.onEmphasis'), - iconBg: get('danger.emphasis'), - iconBorder: unset - }, - loading: { - text: get('fg.default'), - border: get('border.default'), - icon: get('fg.onEmphasis'), - iconBg: get('neutral.emphasis'), - iconBorder: unset - } - }, - timeline: { - text: get('fg.muted'), - badgeSuccessBorder: unset, - targetBadgeBorder: get('accent.emphasis'), - targetBadgeShadow: get('accent.muted') - }, - diffstat: { - neutralBg: get('neutral.muted'), - neutralBorder: get('border.subtle'), - deletionBorder: get('border.subtle'), - additionBorder: get('border.subtle'), - deletionBg: get('danger.emphasis') - }, - diff: { - addition: { - text: get('fg.default'), - bg: get('success.subtle'), - border: get('success.muted') - }, - deletion: { - text: get('fg.default'), - bg: get('danger.subtle'), - border: get('danger.muted') - }, - change: { - text: get('attention.fg'), - bg: get('attention.subtle'), - border: get('attention.muted') - } - }, - mergeBox: { - successIconBg: get('success.emphasis'), - successIconText: get('fg.onEmphasis'), - successIconBorder: unset, - successIndicatorBg: get('success.emphasis'), - successIndicatorBorder: unset, - mergedIconBg: get('done.emphasis'), - mergedIconText: get('fg.onEmphasis'), - mergedIconBorder: unset, - mergedBoxBorder: get('done.emphasis'), - neutralIconBg: get('neutral.emphasis'), - neutralIconText: get('fg.onEmphasis'), - neutralIconBorder: unset, - neutralIndicatorBg: get('neutral.emphasis'), - neutralIndicatorBorder: unset, - warningIconBg: get('attention.emphasis'), - warningIconText: get('fg.onEmphasis'), - warningIconBorder: unset, - warningBoxBorder: get('attention.emphasis'), - warningMergeHighlight: unset, - errorIconBg: get('danger.emphasis'), - errorIconText: get('fg.onEmphasis'), - errorIconBorder: unset, - errorIndicatorBg: get('danger.emphasis'), - errorIndicatorBorder: unset - }, - underlinenav: { - border: unset, - borderHover: get('neutral.muted'), - borderActive: get('primer.border.active'), - text: get('fg.default'), - textHover: get('fg.default'), - textActive: get('fg.default'), - icon: get('fg.subtle'), - iconHover: get('fg.subtle'), - iconActive: get('fg.default'), - counterText: get('fg.default'), - counterBg: get('neutral.muted') - }, - selectMenu: { - borderSecondary: get('border.muted'), - shadow: get('shadow.large'), - backdropBg: get('primer.canvas.backdrop') - }, - sidenav: { - borderActive: get('primer.border.active') - }, - menu: { - headingText: get('fg.default'), - borderActive: get('primer.border.active') - }, - project: { - cardBg: get('canvas.overlay') - }, - prState: { - draft: { - text: get('fg.onEmphasis'), - bg: get('neutral.emphasis'), - border: unset - }, - open: { - text: get('fg.onEmphasis'), - bg: get('success.emphasis'), - border: unset - }, - merged: { - text: get('fg.onEmphasis'), - bg: get('done.emphasis'), - border: unset - }, - closed: { - text: get('fg.onEmphasis'), - bg: get('danger.emphasis'), - border: unset - } - }, - diffBlob: { - numText: get('fg.subtle'), - numHoverText: get('fg.default'), - addition: { - numHoverText: get('fg.default'), - }, - deletion: { - numHoverText: get('fg.default'), - lineBg: get('danger.subtle'), - wordBg: get('danger.muted'), - }, - hunk: { - text: get('fg.muted'), - numBg: get('accent.muted'), - lineBg: get('accent.subtle'), - }, - emptyBlockBg: get('neutral.subtle'), - selectedLineHighlightBg: get('attention.subtle'), - selectedLineHighlightBorder: get('attention.muted'), - expander: { - hoverIcon: get('fg.onEmphasis'), - hoverBg: get('accent.emphasis') - }, - commentButton: { - icon: get('fg.onEmphasis'), - bg: get('accent.emphasis'), - gradientBg: unset - } - }, - globalNav: { - logo: deprecated, - bg: deprecated, - text: deprecated, - icon: deprecated, - inputBg: deprecated, - inputBorder: deprecated, - inputIcon: deprecated, - inputPlaceholder: deprecated, - }, - introShelf: { - gradientLeft: get('accent.subtle'), - gradientRight: get('success.subtle'), - gradientIn: get('canvas.default'), - gradientOut: alpha(get('scale.white'), 0) - } -} diff --git a/data/colors_v2/vars/global_dark.ts b/data/colors_v2/vars/global_dark.ts deleted file mode 100644 index 21526d9c7..000000000 --- a/data/colors_v2/vars/global_dark.ts +++ /dev/null @@ -1,94 +0,0 @@ -import {alpha, get} from '../../../src/utils' - -export default { - fg: { - default: get('scale.gray.1'), - muted: get('scale.gray.3'), - subtle: get('scale.gray.5'), - onEmphasis: get('scale.white') - }, - canvas: { - default: get('scale.gray.9'), - overlay: get('scale.gray.8'), - inset: get('scale.black'), - subtle: get('scale.gray.8'), - }, - border: { - default: get('scale.gray.6'), - muted: get('scale.gray.7'), - subtle: alpha(get('scale.gray.0'), 0.1) - }, - shadow: { - small: '0 0 transparent', - medium: (theme: any) => `0 3px 6px ${get('scale.black')(theme)}`, - large: (theme: any) => `0 8px 24px ${get('scale.black')(theme)}`, - extraLarge: (theme: any) => `0 12px 48px ${get('scale.black')(theme)}` - }, - - // Roles - neutral: { - emphasisPlus: get('scale.gray.4'), - emphasis: get('scale.gray.4'), - muted: alpha(get('scale.gray.4'), 0.4), - subtle: alpha(get('scale.gray.4'), 0.1) - }, - accent: { - fg: get('scale.blue.3'), - emphasis: get('scale.blue.5'), - muted: alpha(get('scale.blue.4'), 0.4), - subtle: alpha(get('scale.blue.4'), 0.15) - }, - success: { - fg: get('scale.green.3'), - emphasis: get('scale.green.5'), - muted: alpha(get('scale.green.4'), 0.4), - subtle: alpha(get('scale.green.4'), 0.15) - }, - attention: { - fg: get('scale.yellow.3'), - emphasis: get('scale.yellow.5'), - muted: alpha(get('scale.yellow.4'), 0.4), - subtle: alpha(get('scale.yellow.4'), 0.15) - }, - severe: { - fg: get('scale.orange.4'), - emphasis: get('scale.orange.5'), - muted: alpha(get('scale.orange.4'), 0.4), - subtle: alpha(get('scale.orange.4'), 0.15) - }, - danger: { - fg: get('scale.red.4'), - emphasis: get('scale.red.5'), - muted: alpha(get('scale.red.4'), 0.4), - subtle: alpha(get('scale.red.4'), 0.15) - }, - done: { - fg: get('scale.purple.4'), - emphasis: get('scale.purple.5'), - muted: alpha(get('scale.purple.4'), 0.4), - subtle: alpha(get('scale.purple.4'), 0.15) - }, - sponsors: { - fg: get('scale.pink.4'), - emphasis: get('scale.pink.5'), - muted: alpha(get('scale.pink.4'), 0.4), - subtle: alpha(get('scale.pink.4'), 0.15) - }, - - // Only meant for Primer components - primer: { - canvas: { - backdrop: alpha(get('scale.black'), 0.8), // use for modal/dialogs - sticky: alpha(get('scale.gray.9'), 0.95) // use for sticky headers - }, - border: { - active: get('scale.coral.3'), - contrast: alpha(get('scale.white'), 0.2) // use to increase contrast - }, - shadow: { - highlight: '0 0 transparent', // top highlight - inset: '0 0 transparent', // top inner shadow - focus: (theme: any) => `0 0 0 3px ${get('scale.blue.8')(theme)}` // blue focus ring - } - } -} diff --git a/data/colors_v2/vars/global_light.ts b/data/colors_v2/vars/global_light.ts deleted file mode 100644 index 041bccce8..000000000 --- a/data/colors_v2/vars/global_light.ts +++ /dev/null @@ -1,94 +0,0 @@ -import {alpha, get, lighten} from '../../../src/utils' - -export default { - fg: { - default: get('scale.gray.9'), - muted: get('scale.gray.6'), - subtle: get('scale.gray.5'), - onEmphasis: get('scale.white') - }, - canvas: { - default: get('scale.white'), - overlay: get('scale.white'), - inset: get('scale.gray.0'), - subtle: get('scale.gray.0'), - }, - border: { - default: get('scale.gray.2'), - muted: lighten(get('scale.gray.2'), 0.03), - subtle: alpha(get('scale.black'), 0.15) - }, - shadow: { - small: (theme: any) => `0 1px 0 ${alpha(get('scale.black'), 0.04)(theme)}`, - medium: (theme: any) => `0 3px 6px ${alpha(get('scale.gray.4'), 0.15)(theme)}`, - large: (theme: any) => `0 8px 24px ${alpha(get('scale.gray.4'), 0.2)(theme)}`, - extraLarge: (theme: any) => `0 12px 28px ${alpha(get('scale.gray.4'), 0.3)(theme)}` - }, - - // Roles - neutral: { - emphasisPlus: get('scale.gray.9'), - emphasis: get('scale.gray.5'), - muted: alpha(get('scale.gray.3'), 0.2), - subtle: alpha(get('scale.gray.1'), 0.5) - }, - accent: { - fg: get('scale.blue.5'), - emphasis: get('scale.blue.5'), - muted: alpha(get('scale.blue.3'), 0.4), - subtle: get('scale.blue.0') - }, - success: { - fg: get('scale.green.5'), - emphasis: get('scale.green.4'), - muted: alpha(get('scale.green.3'), 0.4), - subtle: get('scale.green.0') - }, - attention: { - fg: get('scale.yellow.5'), - emphasis: get('scale.yellow.4'), - muted: alpha(get('scale.yellow.3'), 0.4), - subtle: get('scale.yellow.0') - }, - severe: { - fg: get('scale.orange.5'), - emphasis: get('scale.orange.5'), - muted: alpha(get('scale.orange.3'), 0.4), - subtle: get('scale.orange.0') - }, - danger: { - fg: get('scale.red.5'), - emphasis: get('scale.red.5'), - muted: alpha(get('scale.red.3'), 0.4), - subtle: get('scale.red.0') - }, - done: { - fg: get('scale.purple.5'), - emphasis: get('scale.purple.5'), - muted: alpha(get('scale.purple.3'), 0.4), - subtle: get('scale.purple.0') - }, - sponsors: { - fg: get('scale.pink.5'), - emphasis: get('scale.pink.5'), - muted: alpha(get('scale.pink.3'), 0.4), - subtle: get('scale.pink.0') - }, - - // Only meant to be used by Primer components - primer: { - canvas: { - backdrop: alpha(get('scale.black'), 0.5), // use for modal/dialogs - sticky: alpha(get('scale.white'), 0.95) // use for sticky headers - }, - border: { - active: get('scale.coral.3'), - contrast: alpha(get('scale.black'), 0.1) // use to increase contrast - }, - shadow: { - highlight: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.white'), 0.25)(theme)}`, // top highlight - inset: (theme: any) => `inset 0 1px 0 ${alpha(get('scale.gray.2'), 0.2)(theme)}`, // top inner shadow - focus: (theme: any) => `0 0 0 3px ${alpha(get('scale.blue.5'), 0.3)(theme)}` // blue focus ring - } - } -} diff --git a/data/colors_v2/vars/marketing_dark.ts b/data/colors_v2/vars/marketing_dark.ts deleted file mode 100644 index d9ed0caf7..000000000 --- a/data/colors_v2/vars/marketing_dark.ts +++ /dev/null @@ -1,85 +0,0 @@ -import {alpha, get, lighten, mix} from '../../../src/utils' - -const mktg = { - blue: { - primary: '#4969ed', - secondary: '#3355e0' - }, - green: { - primary: '#2ea44f', - secondary: '#22863a' - }, - purple: { - primary: '#6f57ff', - secondary: '#614eda' - } -} - -// TODO: Migrate once new marketing colors (lemon, lime, indigo) are added -export default { - mktg: { - success: mix(get('scale.green.5'), get('scale.green.4')), - info: mix(get('scale.blue.5'), get('scale.blue.4'), 0.42), - bgShadeGradient: { - top: alpha(get('scale.black'), 0.065), - bottom: alpha(get('scale.black'), 0) - }, - btn: { - bg: { - top: lighten(mktg.blue.primary, 0.05), - bottom: mktg.blue.primary - }, - bgOverlay: { - top: lighten(mktg.blue.secondary, 0.05), - bottom: mktg.blue.secondary - }, - text: get('scale.white'), - primary: { - bg: { - top: lighten(mktg.green.primary, 0.05), - bottom: mktg.green.primary - }, - bgOverlay: { - top: lighten(mktg.green.secondary, 0.05), - bottom: mktg.green.secondary - }, - text: get('scale.white') - }, - enterprise: { - bg: { - top: lighten(mktg.purple.primary, 0.05), - bottom: mktg.purple.primary - }, - bgOverlay: { - top: lighten(mktg.purple.secondary, 0.05), - bottom: mktg.purple.secondary - }, - text: get('scale.white') - }, - outline: { - text: get('scale.white'), - border: alpha(get('scale.white'), 0.3), - hover: { - text: get('scale.white'), - border: alpha(get('scale.white'), 0.5) - }, - focus: { - border: get('scale.white'), - borderInset: alpha(get('scale.white'), 0.5) - } - }, - dark: { - text: get('scale.white'), - border: alpha(get('scale.white'), 0.3), - hover: { - text: get('scale.white'), - border: alpha(get('scale.white'), 0.5) - }, - focus: { - border: get('scale.white'), - borderInset: alpha(get('scale.white'), 0.5) - } - } - } - } -} diff --git a/data/colors_v2/vars/marketing_light.ts b/data/colors_v2/vars/marketing_light.ts deleted file mode 100644 index 8cb22973f..000000000 --- a/data/colors_v2/vars/marketing_light.ts +++ /dev/null @@ -1,85 +0,0 @@ -import {alpha, get, lighten, mix} from '../../../src/utils' - -const mktg = { - blue: { - primary: '#4969ed', - secondary: '#3355e0' - }, - green: { - primary: '#2ea44f', - secondary: '#22863a' - }, - purple: { - primary: '#6f57ff', - secondary: '#614eda' - } -} - -// TODO: Migrate once new marketing colors (lemon, lime, indigo) are added -export default { - mktg: { - success: mix(get('scale.green.5'), get('scale.green.4')), - info: mix(get('scale.blue.5'), get('scale.blue.4'), 0.42), - bgShadeGradient: { - top: alpha(get('scale.black'), 0.065), - bottom: alpha(get('scale.black'), 0) - }, - btn: { - bg: { - top: lighten(mktg.blue.primary, 0.05), - bottom: mktg.blue.primary - }, - bgOverlay: { - top: lighten(mktg.blue.secondary, 0.05), - bottom: mktg.blue.secondary - }, - text: get('scale.white'), - primary: { - bg: { - top: lighten(mktg.green.primary, 0.05), - bottom: mktg.green.primary - }, - bgOverlay: { - top: lighten(mktg.green.secondary, 0.05), - bottom: mktg.green.secondary - }, - text: get('scale.white') - }, - enterprise: { - bg: { - top: lighten(mktg.purple.primary, 0.05), - bottom: mktg.purple.primary - }, - bgOverlay: { - top: lighten(mktg.purple.secondary, 0.05), - bottom: mktg.purple.secondary - }, - text: get('scale.white') - }, - outline: { - text: mktg.blue.primary, - border: alpha(mktg.blue.primary, 0.3), - hover: { - text: mktg.blue.secondary, - border: alpha(mktg.blue.secondary, 0.5) - }, - focus: { - border: mktg.blue.primary, - borderInset: alpha(mktg.blue.primary, 0.5) - } - }, - dark: { - text: get('scale.white'), - border: alpha(get('scale.white'), 0.3), - hover: { - text: get('scale.white'), - border: alpha(get('scale.white'), 0.5) - }, - focus: { - border: get('scale.white'), - borderInset: alpha(get('scale.white'), 0.5) - } - } - } - } -} diff --git a/script/generate-deprecations.ts b/script/generate-deprecations.ts deleted file mode 100644 index 5cabd9a03..000000000 --- a/script/generate-deprecations.ts +++ /dev/null @@ -1,59 +0,0 @@ -import fs from 'fs' -import {parse} from '@babel/parser' -import traverse from '@babel/traverse' -import {Identifier, StringLiteral} from '@babel/types' - -// Temporary script to generate deprecations for the new functional color system. -// Delete this file when the new system is published. - -// To generate `deprecations.json`, run: -// yarn ts-node script/generate-deprecations.ts - -const code = fs.readFileSync('./data/colors_v2/vars/deprecated.ts', 'utf8') - -const ast = parse(code, {sourceType: 'module'}) - -const keyStack: Array = [] -const result: Record = {} - -traverse(ast, { - ObjectProperty: { - enter(path) { - switch (path.node.value.type) { - case 'ObjectExpression': - keyStack.push((path.node.key as Identifier).name) - break - - case 'CallExpression': - if ((path.node.value.callee as Identifier).name === 'get') { - result[[...keyStack, (path.node.key as Identifier).name].join('.')] = (path.node.value - .arguments[0] as StringLiteral).value - } else { - result[[...keyStack, (path.node.key as Identifier).name].join('.')] = null - } - break - - case 'ArrayExpression': - keyStack.push((path.node.key as Identifier).name) - - for (const index in path.node.value.elements) { - result[[...keyStack, index].join('.')] = null - } - - keyStack.pop() - break - - default: - result[[...keyStack, (path.node.key as Identifier).name].join('.')] = null - break - } - }, - exit(path) { - if (path.node.value.type === 'ObjectExpression') { - keyStack.pop() - } - } - } -}) - -fs.writeFileSync('./data/colors_v2/deprecations.json', JSON.stringify(result, null, 2))