-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default Styles Strawman #573
Comments
Thanks @gristow. I think it's easy to get messy with this API -- if unchecked we could end up with a whole bunch of Right now we have a few places to put defaults:
For something like this, perhaps it should go into Taking this a step further, we could have a new |
Yes, @0xfe, that makes more sense, and seems much cleaner. The only advantage I see to using For export default {
stave: {
color: '#999999',
thickness: 1,
ledgerLineColor: '#000000',
ledgerLineThickness: 1.5,
},
}; |
this last way would make importing the <defaults> tag from MusicXML quite easy in the future. |
@gristow Yes, that's kind of how I imagine it. |
This is related to #569 -- especially @mscuthbert's and my back and forth on default stave line & ledger line styles. In particular, it's made me realize that many of these things are a matter of taste, and we should allow an easy way to configure them.
I've been working to standardize the api for styling elements across the codebase and many (most) elements now implement
setStyle(styleObject)
andgetStyle()
.I'm exploring adding the static methods
setDefaultStyle(styleObject)
andgetDefaultStyle()
on elements, which would allow things like:I've got this implemented on a branch for
StaveNote
,Stave
,NoteHead
,Stem
andBeam
but before I go much further I wanted to check in and see if this seems like a logical API structure to everyone?Here's the working branch: https://github.com/gristow/vexflow/tree/house-styles
The text was updated successfully, but these errors were encountered: