*CSS properties don't use extended object syntax #555

Closed
opened 2026-02-20 10:18:38 -05:00 by deekerman · 2 comments
Owner

Originally created by @rogerl50 on GitHub (Aug 31, 2022).

At least for the backgroundCSS property of spinner, the following is valid:

  "backgroundCSS": {
      "color": "red",
      "border": "5px solid black",
      "background-color": "blue"
  },

but the following is not:

  "backgroundCSS": {
    "default": {
      "color": "red",
      "border": "5px solid black",
      "background-color": "blue"
    }
  },

I haven't checked, but I assume the same is true of spinnerCSS and valueCSS for spinner, and handleCSS for pile. Is this intentional?

Originally created by @rogerl50 on GitHub (Aug 31, 2022). At least for the `backgroundCSS` property of `spinner`, the following is valid: ```JSON "backgroundCSS": { "color": "red", "border": "5px solid black", "background-color": "blue" }, ``` but the following is not: ```JSON "backgroundCSS": { "default": { "color": "red", "border": "5px solid black", "background-color": "blue" } }, ``` I haven't checked, but I assume the same is true of `spinnerCSS` and `valueCSS` for `spinner`, and `handleCSS` for `pile`. Is this intentional?
Author
Owner

@robartsd commented on GitHub (Sep 14, 2022):

Yes, this is intentional. The "css" widget property generates a stylesheet for the widget if the nested object form is used. The old special CSS properties allow the setting of inline styles on the widget components. I suppose we could generate for the components, but there is no real need and we'd need to modify the code that generates the stylesheet to generate different stylesheet ids and use different default selectors depending on the widget property that called the the css generation code.

@robartsd commented on GitHub (Sep 14, 2022): Yes, this is intentional. The "css" widget property generates a stylesheet for the widget if the nested object form is used. The old special CSS properties allow the setting of inline styles on the widget components. I suppose we could generate for the components, but there is no real need and we'd need to modify the code that generates the stylesheet to generate different stylesheet ids and use different default selectors depending on the widget property that called the the css generation code.
Author
Owner

@rogerl50 commented on GitHub (Sep 22, 2022):

Works as designed.

@rogerl50 commented on GitHub (Sep 22, 2022): Works as designed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/virtualtabletop#555
No description provided.