Volumetrics-io / mrjs

An extensible WebComponents library for the Spatial Web
https://mrjs.io
MIT License
148 stars 9 forks source link

adding entity level variable css? should we do this? does entity local css need rewrite? #612

Open hanbollar opened 2 months ago

hanbollar commented 2 months ago

@lobau 's notes:

element.computedStyleMap().get('padding-left');
.card {
    --color: var(--border);
    border: 1px solid var(--color);
    color: currentColor;
    text-decoration: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform var(--bounce) 0.5s;
}

.card:hover {
    --color: var(--faded);
    transform: scale(0.98);
}

@michaelthatsit notes:

customEntity extends Entity {
    constructor() {
       this.css.getVar('--color')
       mrjs.app.css.getVar('--color')
    }
....
}
mrjs.css.getVar('selector', '--variable')

related to https://github.com/Volumetrics-io/mrjs/pull/605