-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Packages: Move Custom CSS Properties to new calypso-css-custom-properties
package
#30933
Changes from 27 commits
460ecb0
8f719da
f8bd083
dbdd0ed
008cf02
c992ba1
50f7f4e
f8bce81
927ff12
98a3a72
2d81db5
04e78db
79d1bc3
ff8b964
5017a6d
8d6b823
f236805
1945341
2cac29a
0b6cf2f
4141963
ba2d25a
1e753c9
6ddaffd
d501480
d1479de
5e8baa2
afdb29f
04c0c79
43e0adc
502b56c
0ef1c22
6df1215
9eb4956
79b88b8
82ec0a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
@import 'hex-to-rgb'; | ||
@import '~@automattic/calypso-css-custom-properties/src/shared/functions/_hex-to-rgb'; | ||
@import 'overflow-gradient'; | ||
@import 'z-index'; |
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
rules: { | ||
'import/no-extraneous-dependencies': [ 'error', { packageDir: __dirname } ], | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/__color-studio |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Calypso CSS Custom Properties | ||
|
||
This package contains a number of CSS custom properties (i.e. variables) for use in Calypso. | ||
Most of them are synonyms for colors defined by the [Color Studio](https://automattic.github.io/color-studio/). | ||
|
||
## Build Steps | ||
|
||
``` | ||
npm ci | ||
sirreal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
npm run build | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* eslint-disable import/no-nodejs-modules */ | ||
const { dirname, join } = require( 'path' ); | ||
const { existsSync, mkdirSync, writeFileSync } = require( 'fs' ); | ||
const { renderSync } = require( 'node-sass' ); | ||
|
||
const INPUT_FILE = join( __dirname, '..', 'src', 'custom-properties.scss' ); | ||
const OUTPUT_FILE = join( __dirname, '..', 'dist', 'custom-properties.css' ); | ||
|
||
if ( ! existsSync( dirname( OUTPUT_FILE ) ) ) { | ||
mkdirSync( dirname( OUTPUT_FILE ), { recursive: true } ); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't add an |
||
|
||
const output = renderSync( { file: INPUT_FILE } ); | ||
writeFileSync( OUTPUT_FILE, output.css ); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable import/no-nodejs-modules */ | ||
const { dirname, join } = require( 'path' ); | ||
const { copyFileSync, existsSync, mkdirSync } = require( 'fs' ); | ||
|
||
const srcFile = 'color-variables.scss'; | ||
const target = join( __dirname, '..', 'src', '__color-studio', srcFile ); | ||
|
||
if ( ! existsSync( dirname( target ) ) ) { | ||
mkdirSync( dirname( target ), { recursive: true } ); | ||
} | ||
|
||
copyFileSync( require.resolve( 'color-studio/dist/' + srcFile ), join( target ) ); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
sirreal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"name": "@automattic/calypso-css-custom-properties", | ||
"version": "1.0.0-alpha.0", | ||
"description": "Calypso Shared Style Bits", | ||
"author": "Automattic", | ||
"license": "GPL-2.0-or-later", | ||
"keywords": [ | ||
"calypso", | ||
"wordpress", | ||
"sass", | ||
"css" | ||
], | ||
"homepage": "https://github.com/Automattic/wp-calypso/tree/master/packages/calypso-css-custom-properties/README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Automattic/wp-calypso.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Automattic/wp-calypso/issues" | ||
}, | ||
"engines": { | ||
"node": "^10.13.0", | ||
"npm": "^6.1.0" | ||
}, | ||
"main": "dist/custom-properties.css", | ||
"dependencies": { | ||
"color-studio": "github:automattic/color-studio#1.0.1" | ||
}, | ||
"devDependencies": { | ||
"node-sass": "^4.11.0" | ||
sirreal marked this conversation as resolved.
Show resolved
Hide resolved
sirreal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build": "node bin/build-custom-properties-css.js", | ||
"postinstall": "node bin/postinstall.js" | ||
sirreal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me propose a better name:
calypso-color-schemes
. Because that's what the package contains: definitions of the Calypso color scheme CSS variables. It's not just a random bag of CSS variables, but they all have a common purpose.That's not true 🙂 Color Studio provides the Muriel color palette, something much more generic than Calypso and its color schemes.
This package provides definitions for Calypso color schemes specifically. The default "Classic Bright" and the custom "Classic Blue" and "Laser Black" ones. There are variables like
--color-primary
,--color-accent
and--masterbar-color
that map to themuriel-*
colors provided by Color Studio.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to go with
@automattic/calypso-color-schemes
unless there are any other objections.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm ok with that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1