Comments (2)
I'm willing to hear out arguments for the behavior being different, but this function is working as intended (and as documented).
It gives you the object and asks you to return something:
export interface Mutator {
(
json:
| Partial<Theme.GlobalSettingsAndStyles['settings']>
| Container<Partial<Theme.GlobalSettingsAndStyles['settings']>>,
):
| Partial<Theme.GlobalSettingsAndStyles['settings']>
| Container<Partial<Theme.GlobalSettingsAndStyles['settings']>>
}
interface settings {
(
input?:
| Mutator
| Container<Partial<Theme.GlobalSettingsAndStyles['settings']>>
| Partial<Theme.GlobalSettingsAndStyles['settings']>
| boolean,
raw?: boolean,
): this
}
I think it's more confusing for this function to not use what is returned as a value. And it's pretty easy to always return a value with arrow fns and the container interface:
bud.wpjson.settings(theme => theme
.set('color.custom', false)
.set('color.customDuotone', false)
)
Regardless, wpjson.settings
should arguably be deprecated in #2079 (currently not planning on that). But, I would use bud.wpjson.set
over bud.wpjson.settings
(PR soon on sage itself):
bud.wpjson
.set(`settings.color.custom`, false)
.set(`settings.color.customDuotone`, false)
.set(`settings.color.customGradient`, false)
.set(`settings.color.defaultDuotone`, false)
from bud.
Message to comment on stale issues. If none provided, will not mark issues stale
from bud.
Related Issues (20)
- [bug] Bud should not ignore exceptions thrown by dependent tooling HOT 3
- [request] Support npm package provenance
- [request] Regenerate theme.json when tailwind.config.js updated HOT 3
- [bug] Error when trying to build the project ! HOT 1
- dev url not working with Lando HOT 1
- [bug] could not import sass: problem running hook booted HOT 4
- [bug] Sass with Tailwind config gives an error HOT 2
- [bug] trellis alias causing bud build to log warning HOT 10
- [bug] [email protected] incompatible with [email protected] HOT 3
- [bug] Install hangs on postinstall @roots/browserslist-config (bud 6.14.*) HOT 12
- [bug] `bud-cache` skips assets emitted by plugins HOT 6
- [bug] Bud dev slows down and public keeps growing with hot-update files HOT 4
- [repo] can't upgrade to @yarnpkg/builder@^4.0.0 HOT 3
- [question] Building a bud extension - how to register / expose HOT 1
- [question] best practices for versioning extensions HOT 6
- [bug] When using external IP from another device, styles are unaccessable HOT 3
- [bug] @import'ed tailwind CSS does not invalidate the cache after error with @layer HOT 2
- [bug] using @apply and #{!important} in sage with bud HOT 1
- [bug] `roots` is not defined when using eslint-config HOT 1
- [bug] importing a plugin makes @roots/bud-tailwindcss fail HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bud.