Revert preservation of base component styles by styleable helper to fix stale styles being applied after removal

This commit is contained in:
Andrew Kingston 2021-09-20 16:47:53 +01:00
parent 18506f1235
commit 7663bdb534
1 changed files with 1 additions and 4 deletions

View File

@ -31,9 +31,6 @@ export const styleable = (node, styles = {}) => {
// Creates event listeners and applies initial styles
const setupStyles = (newStyles = {}) => {
// Use empty state styles as base styles if required, but let them, get
// overridden by any user specified styles
const baseString = node.style.cssText
let baseStyles = {}
if (newStyles.empty) {
baseStyles.border = "2px dashed var(--spectrum-global-color-gray-600)"
@ -51,7 +48,7 @@ export const styleable = (node, styles = {}) => {
// Applies a style string to a DOM node
const applyStyles = styleString => {
node.style = `${baseString}${styleString}`
node.style = styleString
}
// Applies the "normal" style definition