Skip to content

Attribute fallback is faulty #12

@egmontkob

Description

@egmontkob

Attribute fallback is briefly explained in sand256.ini.

(It forgets to mention that after falling back to the given section's _default_ there's in turn another round of fallback to [core]/_default_.)

Accordingly, in a scenario like

[core]
    _default_ = black;green;italic
    selected = black;red;bold

in mc the selected file is bold, but not italic.

In the skin viewer the selected file is both bold and italic.


There are some other tricky cases, like the keyword "base" documented there, but not used in any of the skins (maybe we can remove that feature?), I haven't checked how the skin viewer handles that.

While working on #11, I noticed that the current design relies on CSS falling back to the container element's class, as there are nested spans, e.g. <span class="dialog_dhotnormal"> is always nested under a <span class="dialog__default_"> and if this nesting is manually removed then dhotnormal's colors don't appear correctly.

Automatically emitting such nested spans would be somewhat cumbersome. Instead, I'm currently emitting unnested spans with multiple classes, i.e. <span class="dialog__default_ dialog_dhotnormal"> which results in the same CSS fallback. However, since mc's fallback mechanism cannot directly be mapped to CSS, I think I'd prefer a solution where the JS code performs the fallback logic and generates a CSS that contains all the desired attributes for each and every class (without the need for fallback in CSS), so I could just emit an unnested <span class="dialog_dhotnormal"> and it would work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions