8000 consolidate "selector ref" functionality into a re-usable class or function, make it search downwards not just upwards · Issue #300 · lume/lume · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
consolidate "selector ref" functionality into a re-usable class or function, make it search downwards not just upwards #300
Open
@trusktr

Description

@trusktr

Some elements such as TextureProjector, ClipPlane, and SpotLight support referencing or being referenced via attributes that specify a CSS selector. For example,

<lume-clip-plane id="clipPlane1"></lume-clip-plane>
<lume-clip-plane class="clipPlane2"></lume-clip-plane>

<lume-mesh ... has="clip-planes" clip-planes="#clipPlane1, .clipPlane2"></lume-mesh>

This works across shadow roots, but currently upwards shadow trees only. It does not search into sibling shadow trees or downwards. For example the lume-mesh in the example will not be able to reference any lume-clip-planes in a shadow tree that is sibling to the shadow tree it is in or any tree below itself or the siblings', which may be limiting. Let's make it search all reachable roots of the given element, not just in upwards shadow trees.

The implementation of this is currently repeated in a similar way in several classes:

  • ClipPlanesBehavior
  • SpotLight
  • ProjectedMaterialBehavior which is has an improved version of the last two
  • and we're working on more

As we add more elements with references to other elements, we want to stop duplicating the logic.

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

      0