Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple color modes #18

Merged
merged 316 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
316 commits
Select commit Hold shift + click to select a range
11796c5
Update dark.scss
auareyou Oct 2, 2020
f020b15
Implement flatMap by hand
BinaryMuse Oct 2, 2020
ebb4ddf
Merge branch 'mkt/color-modes' into auareyou-light-changes
BinaryMuse Oct 2, 2020
0ca963b
Merge pull request #22 from primer/auareyou-dark-1
auareyou Oct 2, 2020
4982aaf
New gatsby site
colebemis Oct 3, 2020
a800d96
Update data/colors/light.scss
auareyou Oct 5, 2020
e6d856b
Update border colors
simurai Oct 5, 2020
0580fd0
Use typescript
colebemis Oct 5, 2020
e66591e
Add auto scale
simurai Oct 6, 2020
4813158
Merge pull request #21 from primer/auareyou-light-changes
auareyou Oct 6, 2020
8699963
Updating scss files
auareyou Oct 6, 2020
95f8cf7
Update light.scss
auareyou Oct 6, 2020
54a9dc3
Render table of color variables
colebemis Oct 6, 2020
109dae0
Remove template comments
colebemis Oct 6, 2020
be37ff0
Merge pull request #24 from primer/auareyou-patch-2
simurai Oct 7, 2020
5461ed7
Lighten icon-tertiary in dark mode
simurai Oct 7, 2020
d525e4d
Merge branch 'mkt/color-modes' of https://github.com/primer/primitive…
simurai Oct 7, 2020
bcec69c
Update dark.scss
auareyou Oct 7, 2020
cc871fd
Update light.scss
auareyou Oct 7, 2020
27b8d20
Update dark.scss
auareyou Oct 7, 2020
2aa081e
Merge pull request #23 from primer/auareyou-patch-1
auareyou Oct 7, 2020
41c4806
Add page title
colebemis Oct 7, 2020
289de1a
Add favicon
colebemis Oct 7, 2020
f150c92
Update flash alerts
simurai Oct 8, 2020
e8e7cfd
Rename color scale to single digit
simurai Oct 8, 2020
96e5110
Add box-row colors
simurai Oct 8, 2020
94a584e
Use dark background for dark mode column
colebemis Oct 8, 2020
63623fe
Merge pull request #25 from primer/docs
colebemis Oct 8, 2020
10a4ed9
Add path prefix
colebemis Oct 9, 2020
af5eae1
Add vercel config
colebemis Oct 9, 2020
9e6def0
Use "redirects"
colebemis Oct 9, 2020
fa9ddb1
Add "rewrites"
colebemis Oct 9, 2020
6328b39
Update rewrites
colebemis Oct 9, 2020
ffa88b0
Update rewrites
colebemis Oct 9, 2020
b882089
Update dark.scss
auareyou Oct 13, 2020
9a3455a
Merge pull request #26 from primer/auareyou-app-level-updates
simurai Oct 14, 2020
8446567
Changes on icons and borders
auareyou Oct 14, 2020
ccc5a7a
Add watch command
BinaryMuse Oct 14, 2020
007782e
Update.scss
auareyou Oct 14, 2020
5a0af51
Update light.scss
auareyou Oct 14, 2020
2fb44d3
Merge pull request #29 from primer/auareyou-patch-4
auareyou Oct 14, 2020
85928e6
Fix missing var reporting
BinaryMuse Oct 14, 2020
f515e0e
Correct bg-warning-inverse
simurai Oct 15, 2020
1264a05
Merge pull request #28 from primer/auareyou-patch-3
simurai Oct 15, 2020
c215e1e
Swap bg-secondary and bg-tertiary in light mode
simurai Oct 15, 2020
0fb8c91
Update default button hover bg color
Oct 15, 2020
c09bcdc
Add colors for site Header
Oct 15, 2020
412212a
update light mode header bg color
Oct 15, 2020
b577cad
update header logo color dark mode
Oct 15, 2020
3d5a7cb
fix box-header--blue color on dark mode
Oct 15, 2020
d93cf7b
dark mode underline nav
Oct 15, 2020
54c46a7
update dark mode default button bg color
Oct 15, 2020
a5f105b
update social count in dark mode
Oct 15, 2020
91649c4
header search input functional
Oct 15, 2020
9cda941
Add autocomplete colors
simurai Oct 16, 2020
bff6a02
Make avatar border transparent
simurai Oct 16, 2020
6096eb4
Update buttons
simurai Oct 16, 2020
a59e532
update counter dark mode colors
Oct 16, 2020
593708c
fix dropdown tip colors
Oct 16, 2020
4ef22c9
update dropdown box-shadow dark mode
Oct 16, 2020
10e7afa
darken box-shadow on dark mode dropdown
Oct 16, 2020
5463300
fix danger and outline button hover text
Oct 16, 2020
3dafc1d
undo last commit, being weird will do later
Oct 16, 2020
402d12a
Add label colors
simurai Oct 19, 2020
9eac701
Update hex values in colors scales
auareyou Oct 19, 2020
ad0cb66
Merge pull request #30 from primer/auareyou-updates-hex
simurai Oct 20, 2020
abb740a
Typo
simurai Oct 20, 2020
f9fd04b
Update counter
simurai Oct 20, 2020
fe13a8c
Merge branch 'mkt/color-modes' of https://github.com/primer/primitive…
simurai Oct 20, 2020
8efdc39
Add pr-state
simurai Oct 20, 2020
5ca9f4b
update underline-nav and flash functional colors
Oct 20, 2020
45687a0
update underlinenav counter text color
Oct 20, 2020
70e87a6
Add shadow to autocomplete
simurai Oct 21, 2020
0ecefb1
Merge pull request #27 from primer/auareyou-patch-2
simurai Oct 21, 2020
9af2ef9
Update dropdown
simurai Oct 21, 2020
fa37b80
Merge branch 'mkt/color-modes' of https://github.com/primer/primitive…
simurai Oct 21, 2020
1de0179
Update select-menu
simurai Oct 21, 2020
2ed9673
Update branch-name
simurai Oct 21, 2020
a6d51cc
Update navigation
simurai Oct 21, 2020
374ae1e
Updated yellow with the final hex values
auareyou Oct 21, 2020
f9355f3
update parent-child avatar shadow
Oct 21, 2020
a44acbf
update form bg colors
Oct 21, 2020
19ef888
WIP update comment box colors
Oct 21, 2020
f9e3c9a
Merge pull request #31 from primer/auareyou-yellow
simurai Oct 22, 2020
baa69db
Update input
simurai Oct 22, 2020
a85730b
Add input states
simurai Oct 22, 2020
c7548e4
Update links
simurai Oct 22, 2020
ec12c15
Batch of updates
auareyou Oct 22, 2020
9ce7e68
Add a few commas
simurai Oct 22, 2020
d42611e
Merge pull request #32 from primer/auareyou-patch-8
simurai Oct 22, 2020
cacc3de
Update the outputted SCSS mixin
BinaryMuse Oct 22, 2020
90fe697
update footer octicon colors
Oct 22, 2020
ab2da57
fixing css
Oct 22, 2020
1cd410b
update timeline badge colors
Oct 22, 2020
7e36bc4
update diff block colors
Oct 22, 2020
347f74a
update light mode diffstat border colors
Oct 22, 2020
20bc3a3
update diffstat border
Oct 22, 2020
3df3a30
Update outline + danger button
simurai Oct 23, 2020
a94bc22
add colors for verified commit badge
Oct 23, 2020
cde6eea
update verified badge text light mode
Oct 23, 2020
0fefc7f
WIP: Update buttons
simurai Oct 24, 2020
661dae8
Update buttons
simurai Oct 24, 2020
d248e4c
Update primary button
simurai Oct 24, 2020
f663df0
Add topic-tag
simurai Oct 26, 2020
e157478
Update topic-tag
simurai Oct 26, 2020
2e72b3f
Remove topic
simurai Oct 26, 2020
45f5336
Make selected tabnav same as bg-canvas
simurai Oct 26, 2020
9ef25e1
add functional colors for merge box icons
Oct 26, 2020
883cd00
update merg-box warning icon bg
Oct 26, 2020
2f8f2f6
update mergebox colors
Oct 26, 2020
995139d
updating merged box border
Oct 26, 2020
da21f4f
add borders for merge box
Oct 26, 2020
115e68a
Updated diff styles
auareyou Oct 26, 2020
21d9a9a
Error in the selected line highlight
auareyou Oct 26, 2020
1044040
added extra background
auareyou Oct 26, 2020
5cad2c8
Merge branch 'auareyou-diff-changes' of https://github.com/primer/pri…
auareyou Oct 26, 2020
9d38696
Ignore package-lock.json in case it gets accidentally generated
BinaryMuse Oct 26, 2020
b06fa90
Format
simurai Oct 27, 2020
a3c2804
Replace functional variables
simurai Oct 27, 2020
5a36dc8
Add diffstat colors
simurai Oct 27, 2020
d6f6e11
Add comment-button
simurai Oct 27, 2020
ebf26d5
Indent
simurai Oct 27, 2020
73d132c
Merge pull request #33 from primer/auareyou-diff-changes
simurai Oct 27, 2020
6e523ee
Update diff-blob
simurai Oct 27, 2020
1362186
Update hunder and expander color
simurai Oct 27, 2020
c996b75
merge box status indicator colors
Oct 27, 2020
60615e1
fix merge box indicator colors
Oct 27, 2020
06b7fa9
Refactor build script
BinaryMuse Oct 27, 2020
a804d1d
Merge pull request #34 from primer/mkt/improve-color-modes-build
Oct 27, 2020
b588c8b
Update fades so that they don't have numeric keys
BinaryMuse Oct 28, 2020
823b721
Refactor build system
BinaryMuse Oct 28, 2020
8527766
Add deps
BinaryMuse Oct 28, 2020
422853a
Merge remote-tracking branch 'origin/mkt/color-modes' into mkt/refact…
BinaryMuse Oct 28, 2020
45d093b
Merge pull request #35 from primer/mkt/refactor-build
Oct 28, 2020
615e41a
Visualize box-shadows
colebemis Oct 29, 2020
214a68d
Fix box-shadow
simurai Oct 29, 2020
a2fe7c0
Merge branch 'mkt/color-modes' of https://github.com/primer/primitive…
simurai Oct 29, 2020
ab82d62
Use #fff for some buttons
simurai Oct 29, 2020
0981f9b
Change btn border
simurai Oct 29, 2020
b91f935
Added new backgrounds
auareyou Oct 29, 2020
1a45800
added borders to reuse in overlays
auareyou Oct 29, 2020
c499f58
Update light.scss
auareyou Oct 29, 2020
9310bf0
add functional name for warning merge box highlight
Oct 29, 2020
724076c
update merge warning highlight color dark mode
Oct 29, 2020
0d2b1e9
Update data/colors/light.scss
auareyou Oct 30, 2020
1385a06
Darker backdrop
simurai Oct 30, 2020
79e5523
Merge pull request #37 from primer/auareyou-bg-changes
simurai Oct 30, 2020
9846881
update box-header colors
Oct 30, 2020
2893f68
update light mode box-warn border color
Oct 30, 2020
9d55cc8
update branch-name bg functional color
Oct 30, 2020
e82cb6b
add functional name for menu bg
Oct 30, 2020
773ac4d
fix failures
Oct 30, 2020
ae82158
Remove unused variables
simurai Nov 2, 2020
e267bd0
update discussion success bg
Nov 2, 2020
ca7d147
add functional names for project boards
Nov 3, 2020
fd6a5b3
formatting oops
Nov 3, 2020
52c43a6
add color for project header bg
Nov 3, 2020
0887508
dark mode colors for projects side pane
Nov 3, 2020
312293f
Bump publish node version to 12
BinaryMuse Nov 3, 2020
fc45b24
Revert "Bump publish node version to 12"
BinaryMuse Nov 3, 2020
1d8d2d0
Manually set registry URL during publish
BinaryMuse Nov 3, 2020
5fab648
Update to primer/publish@v3.0.0
BinaryMuse Nov 3, 2020
4d25597
Revert "Update to primer/publish@v3.0.0"
BinaryMuse Nov 3, 2020
01be8e2
Setup changesets
BinaryMuse Nov 3, 2020
1cab7ed
Use changesets for prerelease publishing
BinaryMuse Nov 3, 2020
cc9de9b
Add changeset for color modes
BinaryMuse Nov 3, 2020
0ac1f55
Version to 3.0.0
BinaryMuse Nov 3, 2020
d7e38e8
Output new version as status
BinaryMuse Nov 3, 2020
c1d28fb
Try again with the version thing
BinaryMuse Nov 3, 2020
dd4c7a8
Fixup version check output
BinaryMuse Nov 3, 2020
27aa69f
Fixup name and version output for check
BinaryMuse Nov 3, 2020
1dd8795
Change details URL to unpkg
colebemis Nov 3, 2020
7290ab6
Add trailing slash
colebemis Nov 3, 2020
f4822c2
add gradient for project details
Nov 4, 2020
7d6bcd2
Use opaque colors for form tooltips
simurai Nov 5, 2020
b96ad1c
Merge branch 'mkt/color-modes' of https://github.com/primer/primitive…
simurai Nov 5, 2020
b07ef2a
Add toast colors
simurai Nov 5, 2020
9141cbe
Add diff colors
simurai Nov 6, 2020
af5478b
Add marketing icon variables
colebemis Nov 9, 2020
4990647
Move actions-workflow-table-sticky-bg to primitives
simurai Nov 10, 2020
80c1e5f
Add diff-blob mix-blend-mode
simurai Nov 10, 2020
a5fc7f5
Rename icon-folder to files-explorer-icon
simurai Nov 10, 2020
c7af6ca
Update marketing icon colors in dark mode
colebemis Nov 10, 2020
3fb484b
Merge branch 'mkt/color-modes' of github.com:primer/primitives into m…
colebemis Nov 10, 2020
1596b79
Update marketing icon dark colors
colebemis Nov 10, 2020
3c94510
Add repo-language-color-border
simurai Nov 11, 2020
2b36b7c
Add CodeMirror colors
simurai Nov 16, 2020
1749c1d
Add prettylights colors
simurai Nov 16, 2020
34bc6bd
Add ANSI colors
simurai Nov 17, 2020
a6a0a23
Rename grey to gray
simurai Nov 17, 2020
03bc7be
update color-text-primary to use gray-1
Nov 17, 2020
1f0de00
Remove tabnav-selected-bg
simurai Nov 18, 2020
77da905
Remove drag-and-drop-border
simurai Nov 18, 2020
58b933b
Update hidden-text-expander
simurai Nov 18, 2020
da0915e
Revert "Remove drag-and-drop-border"
simurai Nov 18, 2020
08daf9e
Remove previewable-comment-form-bg
simurai Nov 18, 2020
594b280
update input border gray color
Nov 18, 2020
a01d88b
update btn-outline disabled text color
Nov 18, 2020
1079c42
Add orange label
simurai Nov 19, 2020
eae61fb
update disabled primary button bg
Nov 19, 2020
608e872
Add tooltip
simurai Nov 23, 2020
350feef
Merge branch 'mkt/color-modes' of https://github.com/primer/primitive…
simurai Nov 23, 2020
a0e8bbf
Add blob-line-highlight-bg
simurai Nov 23, 2020
e074e06
Update $gray-1
simurai Nov 25, 2020
e99cfca
Replace most $gray-0 with $gray-1
simurai Nov 25, 2020
ebf3d59
Update blob-line-highlight
simurai Nov 27, 2020
a17a855
Update diff-blob
simurai Nov 27, 2020
b441e87
Add fg fade colors
simurai Nov 30, 2020
0762bd6
Add avatar bg
simurai Nov 30, 2020
0c8773b
Add text selection color
simurai Dec 1, 2020
7491a53
update social-count-bg color in dark mode
Dec 1, 2020
519afc4
update markdown-code-bg color in dark mode
Dec 4, 2020
57d36d9
Update data/colors/dark.scss
Dec 4, 2020
b81463a
add search keyword hl
Dec 4, 2020
332b57c
Merge branch 'mkt/color-modes' of github.com:primer/primitives into m…
Dec 4, 2020
f48806e
$$$ ughhh
Dec 4, 2020
59fe074
Allow modes to inherit values from other modes
BinaryMuse Dec 14, 2020
7b9b1c9
Add stub for dimmed mode
BinaryMuse Dec 14, 2020
aa5891c
Update some dimmed colors for testing
BinaryMuse Dec 14, 2020
901d2b8
Update dimmed gray colors
simurai Dec 15, 2020
821818a
Update dimmed black
simurai Dec 15, 2020
636c8a9
Update dimmed white
simurai Dec 15, 2020
7b6ef18
update contr graph color dark mode
Dec 15, 2020
e4c337a
Move dark mode definition to mixin and use for dark and dimmed modes
BinaryMuse Dec 15, 2020
f4d6f3e
update btn dagner icon
Dec 15, 2020
3b6fbd7
Pushed new colors to test diffs
edokoa Dec 15, 2020
793121e
update contribution graph border color dark mode
Dec 16, 2020
4b765d4
rvert gray contr graph border color dark mode
Dec 17, 2020
9c544e3
Fix leaking of avatar background
simurai Dec 22, 2020
2068e0a
Fix disabled danger button text
simurai Dec 22, 2020
b4f8520
Update data/colors/mixins/dark_mode.scss
edokoa Jan 5, 2021
3276d6b
Update data/colors/mixins/dark_mode.scss
edokoa Jan 5, 2021
7b98a84
Brighter blob select yellows fix
edokoa Jan 5, 2021
b6c2f71
Merge pull request #41 from primer/edokoa-diff-view-adjustments
simurai Jan 6, 2021
4af3f68
Increase constrast for branch-name-text
simurai Jan 19, 2021
6bce317
Add intro-shelf colors
simurai Feb 3, 2021
c990fb2
Rename dimmed to dark-dimmed
BinaryMuse Feb 3, 2021
4c34dc7
Use an underscore instead of a dash
BinaryMuse Feb 3, 2021
bdd2b27
Add marketing button colors
simurai Feb 12, 2021
3f6acf6
Add focus-shadow to marketing buttons
simurai Feb 12, 2021
c59a9f7
Rename dark marketing button to transparent
simurai Feb 12, 2021
23a8105
Rename dark marketing button to transparent also in light mode
simurai Feb 12, 2021
9e90230
Change back to dark
simurai Feb 12, 2021
0222de5
Add more marketing variables
simurai Feb 12, 2021
6995b8c
Lower contrast for disabled text
simurai Feb 15, 2021
65982fd
Split light.scss into light_mode.scss
simurai Feb 16, 2021
44d405f
Update dimmed colors
simurai Feb 25, 2021
b83a321
Add checks colors
simurai Mar 1, 2021
a0aeaff
Remove checks-scrollbar
simurai Mar 3, 2021
086cf25
Add more checks colors
simurai Mar 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.4.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/pink-clocks-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/primitives": major
---

Add support for color modes
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Primer Primitives
on: [push]
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@master

- name: Set up Node.js 10.x
uses: actions/setup-node@master
with:
node-version: 10

- name: Install dependencies
run: yarn

- name: Create .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Release snapshot
run: |
yarn changeset version --snapshot
yarn changeset publish --tag canary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Find version
run: |
name=$(jq -r .name package.json)
version=$(jq -r .version package.json)
npx action-status --context="$name" --state=success --description=$version --url "https://unpkg.com/$name@$version/"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
.sass-cache
node_modules
*.log
*.js
*.d.ts
/dist/
/primitives/modes/
/package-lock.json
57 changes: 6 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,19 @@ This repo contains values for color, spacing, and typography primitives for use

## Install

This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `@primer/primitives` with this command.
This repository is distributed on [npm][npm]. After [installing npm][install-npm], you can install `@primer/primitives` with this command.

```sh
$ npm install --save @primer/primitives
```

## Usage

JSON is a highly interoperable format that can be used in many types of projects. You could write scripts to generate CSS, use with plugins for design tools, or import into a theme file for use with CSS-in-JS projects.
Primitive data is served in several formats from the `dist/` folder:

### Example

The Primer Primitives are exported as keys on the top-level export. `colors`, `spacing`, and `typography` are available:

```js
import { colors, spacing, typography } from '@primer/primitives'
```

In addition, Primer Primitives exports a `theme`, which is a great way of sharing system styles and works with popular CSS-in-JS libraries such as [styled-components](https://www.styled-components.com/) and [emotion](https://emotion.sh/).

Here's an example using `styled-components`.

```js
import React from 'react'
import styled, { ThemeProvider } from 'styled-components'
import { theme } from '@primer/primitives'

const Alert = styled.div`
color: ${props => props.theme.colors.green[9]};
background-color: ${props => props.theme.colors.green[2]};
`

const App = props => (
<ThemeProvider theme={theme}>
<Alert />
</ThemeProvider>
)

```

When used with libraries like [styled-system](https://jxnblk.com/styled-system/), you can make Primer Primitives available to style functions. In this example, we've imported the color function to the component's styles argument. The color values are from the color JSON object in Primer Primitives.

```js
import React from 'react'
import styled, { ThemeProvider } from 'styled-components'
import { theme } from '@primer/primitives'
import { color } from 'styled-system'

const Alert = styled.div`
${color}
`

const App = props => (
<ThemeProvider theme={theme}>
<Alert color='green.0' bg='green.2' />
</ThemeProvider>
)

```
* `dist/scss` contains [SCSS][scss] files that define CSS variables to be imported into other SCSS files
* `dist/json` contains JSON files for each set of primitives
* `dist/js` contains CommonJS-style JavaScript modules for each set of primitives, as well as an index file that loads all of the primitives for all primitive types; you can access this via `require('@primer/primitives')`. The JavaScript modules also include TypeScript typings files for use in TypeScript projects.

## License

Expand All @@ -71,3 +25,4 @@ const App = props => (
[primer]: https://github.com/primer/primer
[npm]: https://www.npmjs.com/
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
[scss]: https://sass-lang.com/
Loading