-
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.
added outline support for blocks via theme.json (#43526)
* added outline to theme.json * linting
- Loading branch information
1 parent
e6dd3b1
commit 40efcbe
Showing
5 changed files
with
103 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
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import type { GeneratedCSSRule, Style, StyleOptions } from '../../types'; | ||
import { generateRule } from '../utils'; | ||
|
||
const color = { | ||
name: 'color', | ||
generate: ( | ||
style: Style, | ||
options: StyleOptions, | ||
path: string[] = [ 'outline', 'color' ], | ||
ruleKey: string = 'outlineColor' | ||
): GeneratedCSSRule[] => { | ||
return generateRule( style, options, path, ruleKey ); | ||
}, | ||
}; | ||
|
||
const offset = { | ||
name: 'offset', | ||
generate: ( | ||
style: Style, | ||
options: StyleOptions, | ||
path: string[] = [ 'outline', 'offset' ], | ||
ruleKey: string = 'outlineColor' | ||
): GeneratedCSSRule[] => { | ||
return generateRule( style, options, path, ruleKey ); | ||
}, | ||
}; | ||
|
||
const outlineStyle = { | ||
name: 'style', | ||
generate: ( | ||
style: Style, | ||
options: StyleOptions, | ||
path: string[] = [ 'outline', 'style' ], | ||
ruleKey: string = 'outlineStyle' | ||
): GeneratedCSSRule[] => { | ||
return generateRule( style, options, path, ruleKey ); | ||
}, | ||
}; | ||
|
||
const width = { | ||
name: 'width', | ||
generate: ( | ||
style: Style, | ||
options: StyleOptions, | ||
path: string[] = [ 'outline', 'width' ], | ||
ruleKey: string = 'outlineWidth' | ||
): GeneratedCSSRule[] => { | ||
return generateRule( style, options, path, ruleKey ); | ||
}, | ||
}; | ||
|
||
export default [ color, outlineStyle, offset, width ]; |
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