-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add <style> to spec and make various elements styleable #282
Conversation
The only style property we support at the moment is 'color'. The goal here is simply to establish the infrastructure for styles.
Would it be possible to apply a style element from/to a measure location in a certain part rather than for the whole part? This would easily allow to indicate ranges of cue/a default notes. |
I share your ambivalence about the choice of "style" and prefer "class" instead, to align with HTML/CSS convention.
It looks like detailed conversation about issues like this has happened here previously? See the difference between "properties inherited from a global measure" and "properties inherited from an ancestor" in Joe's examples. |
Not as I read it. In everything I read, styles are applied to elements. A range of cue notes has a starting/end point. It would be weird (for me) to have to individually markup all notes or measures to achieve the effect. The element is probably what I'm looking for though. Looks like this might be used to indicate start/stop of cue notes. |
The contribution I think I can make is with a use case. I write notation via editors, and don't directly edit enough notation syntax to have useful opinions on the proposal's specifics. Use case: voice-specific vocal scores. Imagine a vocal score for a SATB choir with piano accompaniment. There is one staff for each of the four choir sections, and each of these staffs has lyrics. Someones the sections are singing different words at the same time, so their lyrics do not always line up. There is a full two-staff piano part. Singers and accompanist and conductor are rehearsing from this score, using tablet computers. Composer and accompanist set styles so that the score has the typical vocal score layout of 4+2 staffs. Each choir singer can choose styles to give this layout, and/or to highlight their part (their staff, their lyrics) with a bright yellow background, and/or to collapse the other three parts into one multi-voice staff, for a layout of 1 vocal staff (the singer's), 1 other-3-voice vocal staff, and 2 piano staffs. Does this styling proposal enable this use case? Should this use case be achievable by styling alone, or does it require changes to content? |
The layout changes (that is, grouping the other three parts onto one staff) would need to be enabled via extra layout definitions. However, I think that the highlighting could be enabled by giving the lyrics and/or notes for each part a class. Then, the consuming program can apply changes to all elements with that class. The thing is, I don't think that that is what this is designed to do, and having a consuming program relying on those classes being in place seems risky. If I'm understanding it correctly, this proposal is designed to make it possible to define, for example, the style for a "cue" class, and add it to all the appropriate notes/events/sequences. This would be done by the creating program, which would define the exact size change percentage, (or special notehead type, or a color, whatever). Then a consuming program can read that style once and apply it to all the notes with that class when doing a display. Unless I'm sorely mistaken, it's a way to represent the style of the elements in the originating document, not modify them on the fly. Which doesn't mean that they can't eventually be used that way. I just don't think it was part of the original proposal. --Christina |
Me, coming from an HTML/CSS background, I think it would be less confusing if we would name things as follows:
Note that I used the "name"-attribute on an |
I'm also coming from an HTML/CSS background, and I agree with @bhamblok; however (also because of my HTML/CSS background) I think the That brings me to a question – do we need two types of The contents of the For example, XPath:
Or CSS:
I expect that we would support only basic XPath or CSS syntax from the beginning (just an element name, class name, or ID), but it would leave us open to much more flexibility down the road. |
@samuelbradshaw That's a compelling proposal...! I like the fact that it'd be a single, consistent attribute as opposed to the current pull request's two different attributes. Plus the future flexibility for more advanced selectors would be a nice benefit. As for XPath vs. CSS syntax, my anecdotal experience/feelings are:
So I'd vote for CSS syntax, initially limited to element names, classes and IDs. What do other people think? It's a bit of a big change to the proposal, but it's not too late to make it, in my opinion. Executive summary of this proposed changeCurrently, the pull request defines two different ways to target a style:
Instead, the proposed change is to unify the
|
I like CSS syntax a lot because of my bias towards web development – but it would be good to get opinions from others, especially anyone who works in a non-web context. |
I primarily work in a non-web context, and this makes sense to me. Especially if we can (maybe not as MVP) specify selector="note.emphasized" to combine the two selector types. It feels better than having two mutually exclusive attributes or two different elements that serve essentially the same purpose. |
I realize that the following comments might not be within scope for this PR (which I think is an amazing start!), but the confusion in this thread about a This approach has two primary tradeoffs:
For example, @samuelbradshaw's previous example
could be written as this instead:
Again, this may be a longer-term solution; don't want to derail the great work and discussion already in this PR. |
@jsawruk This approach makes a lot of sense at first glance, but we decided against it a while ago — primarily because introducing full CSS syntax would significantly increase the burden for a developer to parse an MNX document. I wouldn't necessarily rule it out for the long term, but for now I see it as not being worth the added complexity. |
Here's a pull request that brings the ideas from #263 into the spec.
The updated docs (as of this pull request) are visible here: https://cdn.githubraw.com/w3c/mnx/issue-263/docs/
See the two new example documents for a very quick overview to get intuition of the general idea:
The specific changes in this pull request are:
I have a few remaining TODOs before this can be merged, but I wanted to start getting feedback on this sooner rather than later. The remaining TODOs are:
I made a few changes from the discussion in #263: