-
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
JSON: How to encode object style selectors #297
Comments
I notice on the linked It seems maybe we need to make a distinction between full objects and simple properties. Our list of objects (https://w3c.github.io/mnx/docs/mnx-reference/objects/) has several items that seem to be simple string or number properties, not full JSON objects {}. After separating those out, it may be easier to see what it makes sense semantically to style. It seems that simple string or number properties won't usually be semantically styleable, but full objects with a |
Agreed with @samuelbradshaw about making a distinction between full objects and simple properties. If it doesn't parse as a Javascript object / Python dict, it's something else. But as the discussion in #295 progresses, I don't think we necessarily need a (p.s. -- I spelled |
+1 for "classes" instead of class, to avoid reserved keywords, but also to use a plural word where a list/array is expected. ( |
In the MNX style system, there are two ways of targeting a style:
"highlight"
red)This issue concerns the latter. When MNX was XML-based, targetting based on object types had a natural solution: you'd just use the element name (
note
targets<note>
elements, etc.). But in JSON, objects don't have an inherent name that's directly encoded in the document.This suggests we need to provide an enum of addressable style selectors. More precisely, we need to provide a list of the following:
"note"
)Even if we were still using XML, we likely would have had to define this list. It wouldn't have been feasible to allow any type of XML element to be styled, because that doesn't semantically make sense in all cases.
With this in mind, here's my proposal:
Thoughts or alternate proposals?
The text was updated successfully, but these errors were encountered: