SED-ML / sed-ml

Simulation Experiment Description Markup Language (SED-ML)
http://sed-ml.org
5 stars 2 forks source link

Add ability to unset style attributes in child styles #206

Open jonrkarr opened 2 years ago

jonrkarr commented 2 years ago

SED-ML supports style inheritance which borrows ideas from CSS. However, there's no way to unset styles in children, unlike in CSS.

For example:

Currently, if a child style has fill=null, my interpretation is that this means that the base fill style should be used. fill=Fill(color=null) could potentially mean unset the parent fill style, but (a) color is currently required and (b) this wouldn't work for the Line and Marker classes which have multiple attributes.

This could be addressed with a special color value "none".

luciansmith commented 2 years ago

Given that there's a 'none' type for lines and markers, the more 'sed-ml-ish' way of doing this would be to give a 'type' attribute to 'fill', which could be 'fill' or 'none'.

I could see 'none' as a special color also working, but that might cause issues with lines and markers,

However, there's another issue here that this doesn't address, namely, that it's not possible for a child object to set some feature to 'unset' (aka 'use whatever you like'). So once a line thickness is set, you can set it to something else, but you can no longer say 'use the default'. I'm not sure if we want to try to allow this or not, but it is indeed a feature that SED-ML doesn't have.

(Note that any given style may still be used and defined anywhere, you just can't define some styles as children of some other styles. Not sure this is a critical feature or not.)