onlook icon indicating copy to clipboard operation
onlook copied to clipboard

[bug] Deleting bg class from properties UI

Open drfarrell opened this issue 2 months ago • 7 comments

When a user deletes a background from the UI sidepanel, actually remove the background class. What happens is the bg class in the tailwind classes gets replaced with bg-[#00000000] which isn't the same as removing the bg entirely.

This is because we're not currently deleting CSS attributes, only updating or overwrite them. You can see the implementation here: https://github.com/onlook-dev/onlook/blob/main/apps/studio/electron/preload/webview/style/index.ts#L79

Implementation recommendation: We should implement a delete pattern wherein you can be given a CSSStyle and remove the key value from the stylesheet. This should also update the update style action with the capability to delete as well.

drfarrell avatar Dec 21 '24 00:12 drfarrell