Skip to content

Commit 5aa7539

Browse files
Eduardo Vargas Torressnowystingerdannify
authored
FIX-1030: Add a light theme to supported themes (#1046)
* FIX-1030: Add a light theme to supported themes * Add theme to monorepo & documentation Co-authored-by: Robert Snow <[email protected]> Co-authored-by: Danni <[email protected]>
1 parent be95719 commit 5aa7539

File tree

6 files changed

+94
-4
lines changed

6 files changed

+94
-4
lines changed

packages/@adobe/react-spectrum/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export {Heading, Keyboard, Text} from '@react-spectrum/text';
3737
export {TextArea, TextField} from '@react-spectrum/textfield';
3838
export {theme as darkTheme} from '@react-spectrum/theme-dark';
3939
export {theme as defaultTheme} from '@react-spectrum/theme-default';
40+
export {theme as lightTheme} from '@react-spectrum/theme-light';
4041
export {Content, Footer, Header, View} from '@react-spectrum/view';
4142
export {Well} from '@react-spectrum/well';
4243
export {Item, Section} from '@react-stately/collections';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @react-spectrum/theme-light
2+
3+
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright 2020 Adobe. All rights reserved.
3+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License. You may obtain a copy
5+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under
8+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9+
* OF ANY KIND, either express or implied. See the License for the specific language
10+
* governing permissions and limitations under the License.
11+
*/
12+
13+
export * from './src';
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "@react-spectrum/theme-light",
3+
"version": "3.1.0",
4+
"description": "Spectrum UI components in React",
5+
"license": "Apache-2.0",
6+
"main": "dist/main.js",
7+
"module": "dist/module.js",
8+
"types": "dist/types.d.ts",
9+
"source": "src/index.ts",
10+
"files": [
11+
"dist",
12+
"src"
13+
],
14+
"sideEffects": [
15+
"*.css"
16+
],
17+
"targets": {
18+
"main": {
19+
"includeNodeModules": [
20+
"@adobe/spectrum-css-temp"
21+
]
22+
},
23+
"module": {
24+
"includeNodeModules": [
25+
"@adobe/spectrum-css-temp"
26+
]
27+
}
28+
},
29+
"repository": {
30+
"type": "git",
31+
"url": "https://github.com/adobe/react-spectrum"
32+
},
33+
"dependencies": {
34+
"@babel/runtime": "^7.6.2",
35+
"@react-types/provider": "^3.1.0"
36+
},
37+
"devDependencies": {
38+
"@adobe/spectrum-css-temp": "^3.0.0-alpha.1"
39+
},
40+
"publishConfig": {
41+
"access": "public"
42+
}
43+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2020 Adobe. All rights reserved.
3+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License. You may obtain a copy
5+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under
8+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9+
* OF ANY KIND, either express or implied. See the License for the specific language
10+
* governing permissions and limitations under the License.
11+
*/
12+
13+
/// <reference types="css-module-types" />
14+
15+
import darkest from '@adobe/spectrum-css-temp/vars/spectrum-darkest.css';
16+
import global from '@adobe/spectrum-css-temp/vars/spectrum-global.css';
17+
import large from '@adobe/spectrum-css-temp/vars/spectrum-large.css';
18+
import lightest from '@adobe/spectrum-css-temp/vars/spectrum-lightest.css';
19+
import medium from '@adobe/spectrum-css-temp/vars/spectrum-medium.css';
20+
import {Theme} from '@react-types/provider';
21+
22+
export let theme: Theme = {
23+
global,
24+
light: lightest,
25+
dark: darkest,
26+
medium,
27+
large
28+
};

packages/dev/docs/pages/react-spectrum/theming.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ which define the values for the variables in each color scheme and platform scal
9292
a CSS class which includes the variables it defines, and `Provider` applies these classes according to
9393
media queries and prop settings.
9494

95-
React Spectrum includes two themes by default. The `defaultTheme` uses the Spectrum `light` and `darkest` color themes
96-
and is suitable for most applications. The `darkTheme` uses the Spectrum `dark` and `darkest` color themes, and is
97-
suitable for applications that are optimal with a darker interface regardless of operating system setting
98-
(e.g. photo/video editors). See the [Spectrum color](https://spectrum.adobe.com/page/color/#Color-themes-and-modes)
95+
React Spectrum includes three themes by default.
96+
1. The `defaultTheme` uses the Spectrum `light` and `darkest` color themes and is suitable for most applications.
97+
2. The `darkTheme` uses the Spectrum `dark` and `darkest` color themes, and is suitable for applications that are optimal with a darker interface regardless of operating system setting (e.g. photo/video editors).
98+
3. The `lightTheme` uses the Spectrum `lightest` and `darkest` color themes, and is suitable for applications that require high brightness levels while in light mode and high contrast ratios while in dark mode.
99+
100+
See the [Spectrum color](https://spectrum.adobe.com/page/color/#Color-themes-and-modes)
99101
page for more information.
100102

101103
Import your desired theme and pass it to your application's `Provider` to apply it.

0 commit comments

Comments
 (0)