-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from woocommerce/add/6-make-color-editable
Make color editable
- Loading branch information
Showing
10 changed files
with
184 additions
and
63 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 |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
"lint:css": "wp-scripts lint-style", | ||
"lint:js": "wp-scripts lint-js", | ||
"start": "wp-scripts start", | ||
"test": "wp-scripts test-unit-js", | ||
"test:coverage": "wp-scripts test-unit-js --coverage", | ||
"test": "wp-scripts test-unit-js --verbose", | ||
"test:coverage": "wp-scripts test-unit-js --coverage --verbose", | ||
"test:help": "wp-scripts test-unit-js --help", | ||
"test:watch": "wp-scripts test-unit-js --watchAll", | ||
"phpcbf": "composer run phpcbf", | ||
|
@@ -32,7 +32,10 @@ | |
"dependencies": { | ||
"@wordpress/block-editor": "^8.0.0", | ||
"@wordpress/blocks": "^11.1.0", | ||
"autoprefixer": "10.4.2", | ||
"classnames": "^2.3.1", | ||
"eslint": "^7.32.0", | ||
"lodash.kebabcase": "^4.1.1", | ||
"prettier": "npm:[email protected]" | ||
}, | ||
"devDependencies": { | ||
|
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
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
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,19 +1,21 @@ | ||
.wc-free-shipping-progress-bar__outer { | ||
align-items: center; | ||
.wc-free-shipping-progress-bar__progress[value] { | ||
appearance: none; | ||
background: transparent; | ||
border: 2px solid #ddd; | ||
border-radius: 4px; | ||
display: flex; | ||
height: 2em; | ||
justify-content: center; | ||
border: 1px solid currentColor; | ||
border-radius: 3px; | ||
height: 20px; | ||
margin: 0.5em 0 2em; | ||
padding: 0.1em; | ||
position: relative; | ||
width: 100%; | ||
} | ||
.wc-free-shipping-progress-bar__inner { | ||
background: #4c566a; | ||
border-radius: 3px; | ||
height: 100%; | ||
left: 0; | ||
position: absolute; | ||
|
||
.wc-free-shipping-progress-bar__progress[value]::-webkit-progress-bar { | ||
background: transparent; | ||
} | ||
|
||
.wc-free-shipping-progress-bar__progress[value]::-webkit-progress-value { | ||
background: currentColor; | ||
} | ||
|
||
.wc-free-shipping-progress-bar__progress[value]::-moz-progress-bar { | ||
background: currentColor; | ||
} |
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,22 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import kebabCase from 'lodash.kebabcase'; | ||
|
||
export function getColorClass( colorSlug, colorContextName ) { | ||
if ( ! colorSlug || ! colorContextName ) { | ||
return undefined; | ||
} | ||
|
||
return `has-${ kebabCase( | ||
colorSlug | ||
) }-${ colorContextName } has-text-color`; | ||
} | ||
|
||
export function getColorCode( colorCode, colorProps, scope ) { | ||
if ( colorProps !== undefined && colorProps.style !== undefined ) { | ||
return colorProps.style[ scope ]; | ||
} | ||
|
||
return colorCode || 'currentColor'; | ||
} |
Oops, something went wrong.