-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
9,810 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-env", "@babel/preset-react"] | ||
} |
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,3 @@ | ||
node_modules | ||
dist | ||
webpack.config.js |
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,20 @@ | ||
{ | ||
"extends": [ | ||
"plugin:@wordpress/eslint-plugin/recommended" | ||
], | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"comma-dangle": [2, "never"] | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module" | ||
} | ||
} |
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 @@ | ||
# Exclude from release archives. | ||
|
||
/.editorconfig export-ignore | ||
/.git export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/CHANGELOG.md export-ignore | ||
/composer.lock export-ignore | ||
/contributing.md export-ignore | ||
/LICENSE export-ignore | ||
/package.json export-ignore | ||
/webpack.config.js export-ignore | ||
/.babelrc export-ignore | ||
/src/*.js export-ignore | ||
/composer.json export-ignore | ||
/package-lock.json export-ignore | ||
/README.md export-ignore | ||
|
||
# Handle line endings. | ||
# See https://help.github.com/articles/dealing-with-line-endings/ | ||
|
||
* text eol=lf |
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,21 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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,3 @@ | ||
## 1.0 - 2019-09-07 | ||
|
||
Initial Release. |
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,23 @@ | ||
Example: | ||
|
||
```php | ||
new \WPLemon\Field\WCAGTextColor( [ | ||
'settings' => 'my_setting', | ||
'label' => esc_html__( 'My Color Control', 'textdomain' ), | ||
'description' => esc_html__( 'A description here.', 'textdomain' ), | ||
'section' => 'my_section', | ||
'default' => '', | ||
'transport' => 'postMessage', | ||
'choices' => [ | ||
'formComponent' => 'ChromePicker', | ||
'backgroundColor' => 'test_accessible_textcolor_control_background', // setting-name or hardcoded color. | ||
'textColor' => 'test_accessible_textcolor_control', // setting-name or hardcoded color. | ||
'show' => [ | ||
'auto' => false, | ||
'recommended' => false, | ||
'custom' => true, | ||
], | ||
], | ||
'sanitize_callback' => 'sanitize_text_field', | ||
] ); | ||
``` |
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,80 @@ | ||
<?php | ||
/** | ||
* Bootstrap the control. | ||
* | ||
* Addon control for the Kirki Toolkit for WordPress. | ||
* Adds a new colorpicker control to the WordPress Customizer, | ||
* allowing developers to build colorpickers that automatically suggest accessible link colors | ||
* depending on the value of a background color and the surrounding-text. | ||
* | ||
* @package wcag-linkcolor | ||
* @category Addon | ||
* @author Ari Stathopoulos | ||
* @copyright Copyright (c) 2019, Ari Stathopoulos | ||
* @license https://opensource.org/licenses/MIT | ||
* @since 2.0 | ||
*/ | ||
|
||
// Exit if accessed directly. | ||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
add_filter( | ||
'kirki_control_types', | ||
|
||
/** | ||
* Registers the control with Kirki. | ||
* | ||
* @since 1.0 | ||
* @param array $controls An array of controls registered with the Kirki Framework. | ||
* @return array | ||
*/ | ||
function( $controls ) { | ||
require_once __DIR__ . '/src/Control/WCAGTextColor.php'; | ||
$controls['kirki-wcag-tc'] = '\WPLemon\Control\WCAGTextColor'; | ||
return $controls; | ||
} | ||
); | ||
|
||
add_action( | ||
'customize_register', | ||
|
||
/** | ||
* Registers the control type and make it eligible for | ||
* JS templating in the Customizer. | ||
* | ||
* @since 1.0 | ||
* @param WP_Customize $wp_customize The Customizer object. | ||
* @return void | ||
*/ | ||
function( $wp_customize ) { | ||
require_once __DIR__ . '/src/Control/WCAGTextColor.php'; | ||
$wp_customize->register_control_type( '\WPLemon\Control\WCAGTextColor' ); | ||
|
||
// Add class aliases for backwards compatibility. | ||
class_alias( '\WPLemon\Control\WCAGTextColor', 'Kirki_WCAG_Text_Color' ); | ||
}, | ||
0 | ||
); | ||
|
||
/** | ||
* Autoload Field for the Kirki v4.0 API. | ||
* | ||
* @since 2.0 | ||
*/ | ||
spl_autoload_register( | ||
/** | ||
* Autoload the class. | ||
* | ||
* @param string $class The class-name. | ||
*/ | ||
function( $class ) { | ||
if ( 'WPLemon\Field\WCAGTextColor' === $class || '\WPLemon\Field\WCAGTextColor' === $class ) { | ||
require_once __DIR__ . '/src/Field/WCAGTextColor.php'; | ||
} | ||
if ( 'WPLemon\Control\WCAGTextColor' === $class || '\WPLemon\Control\WCAGTextColor' === $class ) { | ||
require_once __DIR__ . '/src/Control/WCAGTextColor.php'; | ||
} | ||
}, false, true | ||
); |
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,28 @@ | ||
{ | ||
"name": "wplemon/control-wcag-linkcolor", | ||
"type": "library", | ||
"description": "Color control for the Kirki Customizer framework using react-color.", | ||
"keywords": ["wordpress","customizer","framework"], | ||
"homepage": "https://aristath.github.io/kirki", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Ari Stathopoulos", | ||
"email": "[email protected]", | ||
"homepage": "http://aristath.github.io", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.6", | ||
"kirki-framework/control-base": "dev-master", | ||
"kirki-framework/field": "dev-master", | ||
"kirki-framework/url-getter": "*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"WPLemon\\Control\\": "src/Control", | ||
"WPLemon\\Field\\": "src/Field" | ||
} | ||
} | ||
} |
Oops, something went wrong.