Skip to content

Commit

Permalink
Merge pull request #1058 from primer/cb/ts-theme
Browse files Browse the repository at this point in the history
Migrate theme to TypeScript
  • Loading branch information
colebemis authored Feb 19, 2021
2 parents edca2de + 508f0bd commit 72d64f9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-lizards-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/components": patch
---

Migrate theme to TypeScript
File renamed without changes.
17 changes: 5 additions & 12 deletions src/theme-preval.js → src/theme-preval.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// @preval

const {colors: colorPrimitives, typography} = require('@primer/primitives')
const {lighten, rgba, desaturate} = require('polished')
import {colors as colorPrimitives, typography} from '@primer/primitives'
import {lighten, rgba, desaturate} from 'polished'

const {lineHeights} = typography
const {black, white, pink, gray, blue, green, orange, purple, red, yellow} = colorPrimitives
// General
const colors = {
export const colors = {
bodytext: gray[9],
black,
white,
Expand Down Expand Up @@ -350,7 +348,7 @@ const stateLabels = {
}
}

const theme = {
export const theme = {
// General
borderWidths,
breakpoints,
Expand All @@ -373,11 +371,6 @@ const theme = {
stateLabels
}

module.exports = {
theme,
colors
}

function fontStack(fonts) {
function fontStack(fonts: string[]) {
return fonts.map(font => (font.includes(' ') ? `"${font}"` : font)).join(', ')
}
5 changes: 0 additions & 5 deletions src/theme.js

This file was deleted.

4 changes: 4 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {theme, colors} from /* preval */ './theme-preval'

export default theme
export {colors}

1 comment on commit 72d64f9

@vercel
Copy link

@vercel vercel bot commented on 72d64f9 Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.