Skip to content

Commit

Permalink
✨ feat(patch): add theme.spacing support to theme.json generator (#2528)
Browse files Browse the repository at this point in the history
For [@roots/bud-tailwindcss](https://bud.js.org/extensions/bud-tailwindcss)+[@roots/bud-wordpress-preset](https://bud.js.org/extensions/bud-wordpress-preset) users: Add support for `theme.spacing` and `theme.extend.spacing` to theme.json generator.

## Example

```ts
  bud.wpjson
    .useTailwindColors()
    .useTailwindFontFamily()
    .useTailwindFontSize()
    .useTailwindSpacing()
```

## Reference

- Feature proposed in #2184 

## Type of change

**PATCH: backwards compatible change**
  • Loading branch information
kellymears committed Dec 21, 2023
1 parent 5292394 commit e025a7b
Show file tree
Hide file tree
Showing 12 changed files with 496 additions and 104 deletions.
5 changes: 3 additions & 2 deletions examples/sage/bud.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ export default async bud => {
.serve(3000)
.proxy('http://example.test')

bud.wpjson
.useTailwindColors(true)
bud.wp.json
.useTailwindColors('extend')
.useTailwindFontFamily()
.useTailwindFontSize()
.useTailwindSpacing()
}
4 changes: 2 additions & 2 deletions sources/@repo/yarn-plugin-bud/bundles/@yarnpkg/plugin-bud.js

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
Expand Up @@ -10,14 +10,17 @@ export class GitHookCommitMsg extends Command {
public emoji = {
chore: `🧹`,
deps: `📦`,
docs: `📕`,
feat: `✨`,
fix: `🩹`,
improve: `🔨`,
merge: `🔀`,
release: `🚀`,
test: `🧪`,
}

public validator =
/^(chore|feat|fix|test|deps):(none|patch|minor|major)(.*)/
/^(chore|deps|docs|feat|fix|improve|merge|release|test):(none|patch|minor|major)(.*)/

public exit = (...messages: Array<string>): never => {
messages.map(message => this.context.stderr.write(`${message}\n`))
Expand Down Expand Up @@ -48,7 +51,7 @@ export class GitHookCommitMsg extends Command {
this.exit(
`Invalid commit message format\n`,
`Message should follow the format: <type>:<severity> <description>\n`,
`Where <type> is one of: chore, deps, feat, fix, release, test\n`,
`Where <type> is one of: chore, deps, docs, feat, fix, improve, merge, release, test\n`,
`And <severity> is one of: none, patch, minor, major\n`,
`Example: feat:minor add new feature`,
)
Expand Down
Loading

0 comments on commit e025a7b

Please sign in to comment.