-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
@wordpress/base-styles
package (#17883)
- Move `assets/stylesheets/*` to the new package - Move admin color schemes to the new package
- Loading branch information
Showing
18 changed files
with
164 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,7 @@ | ||
const { adminColorSchemes } = require( '@wordpress/base-styles' ); | ||
|
||
module.exports = [ | ||
require( '@wordpress/postcss-themes' )( { | ||
defaults: { | ||
primary: '#0085ba', | ||
secondary: '#11a0d2', | ||
toggle: '#11a0d2', | ||
button: '#007cba', | ||
outlines: '#007cba', | ||
}, | ||
themes: { | ||
'admin-color-light': { | ||
primary: '#0085ba', | ||
secondary: '#c75726', | ||
toggle: '#11a0d2', | ||
button: '#0085ba', | ||
outlines: '#007cba', | ||
}, | ||
'admin-color-blue': { | ||
primary: '#82b4cb', | ||
secondary: '#d9ab59', | ||
toggle: '#82b4cb', | ||
button: '#d9ab59', | ||
outlines: '#417e9B', | ||
}, | ||
'admin-color-coffee': { | ||
primary: '#c2a68c', | ||
secondary: '#9fa47b', | ||
toggle: '#c2a68c', | ||
button: '#c2a68c', | ||
outlines: '#59524c', | ||
}, | ||
'admin-color-ectoplasm': { | ||
primary: '#a7b656', | ||
secondary: '#c77430', | ||
toggle: '#a7b656', | ||
button: '#a7b656', | ||
outlines: '#523f6d', | ||
}, | ||
'admin-color-midnight': { | ||
primary: '#e14d43', | ||
secondary: '#77a6b9', | ||
toggle: '#77a6b9', | ||
button: '#e14d43', | ||
outlines: '#497b8d', | ||
}, | ||
'admin-color-ocean': { | ||
primary: '#a3b9a2', | ||
secondary: '#a89d8a', | ||
toggle: '#a3b9a2', | ||
button: '#a3b9a2', | ||
outlines: '#5e7d5e', | ||
}, | ||
'admin-color-sunrise': { | ||
primary: '#d1864a', | ||
secondary: '#c8b03c', | ||
toggle: '#c8b03c', | ||
button: '#d1864a', | ||
outlines: '#837425', | ||
}, | ||
}, | ||
} ), | ||
require( '@wordpress/postcss-themes' )( adminColorSchemes ), | ||
require( 'autoprefixer' )( { grid: true } ), | ||
require( 'postcss-color-function' ), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Base Styles | ||
|
||
Base SCSS utilities and variables for WordPress. | ||
|
||
## Installation | ||
|
||
Install the module | ||
|
||
```bash | ||
npm install @wordpress/base-styles --save-dev | ||
``` | ||
|
||
## Use | ||
|
||
### SCSS utilities and variables | ||
|
||
In your application's SCSS file, include styles like so: | ||
|
||
```scss | ||
@import "node_modules/@wordpress/base-styles/colors"; | ||
@import "node_modules/@wordpress/base-styles/variables"; | ||
@import "node_modules/@wordpress/base-styles/mixins"; | ||
@import "node_modules/@wordpress/base-styles/breakpoints"; | ||
@import "node_modules/@wordpress/base-styles/animations"; | ||
@import "node_modules/@wordpress/base-styles/z-index"; | ||
``` | ||
|
||
If you use [Webpack](https://webpack.js.org/) for your SCSS pipeline, you can use `~` to resolve to `node_modules`: | ||
|
||
```scss | ||
@import "~@wordpress/base-styles/colors"; | ||
``` | ||
|
||
To make that work with [`sass`](https://www.npmjs.com/package/sass) or [`node-sass`](https://www.npmjs.com/package/node-sass) NPM modules without Webpack, you'd have to use [includePaths option](https://sass-lang.com/documentation/js-api#includepaths): | ||
|
||
```json | ||
{ | ||
"includePaths": ["node_modules"] | ||
} | ||
``` | ||
|
||
### PostCSS color schemes | ||
|
||
To use color schemes with [`@wordpress/postcss-themes`](https://www.npmjs.com/package/@wordpress/postcss-themes), import them like so: | ||
|
||
```js | ||
const { adminColorSchemes } = require( '@wordpress/base-styles' ); | ||
const wpPostcss = require( '@wordpress/postcss-themes' )( adminColorSchemes ) | ||
``` | ||
|
||
<br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
exports.adminColorSchemes = { | ||
defaults: { | ||
primary: '#0085ba', | ||
secondary: '#11a0d2', | ||
toggle: '#11a0d2', | ||
button: '#007cba', | ||
outlines: '#007cba', | ||
}, | ||
themes: { | ||
'admin-color-light': { | ||
primary: '#0085ba', | ||
secondary: '#c75726', | ||
toggle: '#11a0d2', | ||
button: '#0085ba', | ||
outlines: '#007cba', | ||
}, | ||
'admin-color-blue': { | ||
primary: '#82b4cb', | ||
secondary: '#d9ab59', | ||
toggle: '#82b4cb', | ||
button: '#d9ab59', | ||
outlines: '#417e9B', | ||
}, | ||
'admin-color-coffee': { | ||
primary: '#c2a68c', | ||
secondary: '#9fa47b', | ||
toggle: '#c2a68c', | ||
button: '#c2a68c', | ||
outlines: '#59524c', | ||
}, | ||
'admin-color-ectoplasm': { | ||
primary: '#a7b656', | ||
secondary: '#c77430', | ||
toggle: '#a7b656', | ||
button: '#a7b656', | ||
outlines: '#523f6d', | ||
}, | ||
'admin-color-midnight': { | ||
primary: '#e14d43', | ||
secondary: '#77a6b9', | ||
toggle: '#77a6b9', | ||
button: '#e14d43', | ||
outlines: '#497b8d', | ||
}, | ||
'admin-color-ocean': { | ||
primary: '#a3b9a2', | ||
secondary: '#a89d8a', | ||
toggle: '#a3b9a2', | ||
button: '#a3b9a2', | ||
outlines: '#5e7d5e', | ||
}, | ||
'admin-color-sunrise': { | ||
primary: '#d1864a', | ||
secondary: '#c8b03c', | ||
toggle: '#c8b03c', | ||
button: '#d1864a', | ||
outlines: '#837425', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "@wordpress/base-styles", | ||
"version": "1.0.0-alpha.1", | ||
"description": "Base SCSS utilities and variables for WordPress.", | ||
"author": "The WordPress Contributors", | ||
"license": "GPL-2.0-or-later", | ||
"keywords": [ | ||
"wordpress", | ||
"sass", | ||
"scss", | ||
"css" | ||
], | ||
"homepage": "https://github.com/WordPress/gutenberg/tree/master/packages/base-styles/README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/WordPress/gutenberg.git", | ||
"directory": "packages/base-styles" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/WordPress/gutenberg/issues" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"includePaths": [ | ||
"node_modules" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters