Sublime Forum

Customizing default user interface theme: Question about scrollbar

#1

If you open the default user interface theme, you can find the following part:

{
  "class": "puck_control",
  "layer0.texture": "Theme - Default/common/scroll.png",
  "layer0.tint": "var(scroll_bar_puck_bg)",
  "layer0.opacity": { "target": 0.2, "speed": 5.0, "interpolation": "smoothstep" },
  "layer0.inner_margin": 2,
  "content_margin": [0, 12]
},
{
  "class": "puck_control",
  "parents": [
    {"class": "scroll_bar_control", "attributes": ["hover"]},
    {"class": "scroll_track_control"}, // <------------------- ?
  ],
  "layer0.opacity": { "target": 0.6, "speed": 5.0, "interpolation": "smoothstep" },
},

In simple words, it controls how the main scrollbar looks.

My question: Could anybody explain what is the purpose of the following line there?

{"class": "scroll_track_control"},

I did’t figure it out neither by reasoning, nor by testing. In other words, isn’t it that scroll_track_control is always a parent of puck_control?

0 Likes

#2

The rule actually appears to be redundant.

"parents" contains a list of parent controls and states they must have for current rule to apply.

It is used to

  1. restrict rules to certain child controls. (e.g.: sidebar scrollbar puck, quickpanel scrollbar puck,…)
  2. apply rule only on certain states of given parent controls.
1 Like