Customize the colour of dropdown background in zelos theme

71 views
Skip to first unread message

Jing An Tew

unread,
Dec 27, 2023, 1:24:27 PM12/27/23
to Blockly
As mentioned in the title, is there a way of customizing the dropdown background colour in the zelos theme. It currently defaults to the same colour as the block colour as shown in 
the image below.

Thanks,
Jing An

Beka Westberg

unread,
Jan 2, 2024, 12:34:06 PM1/2/24
to blo...@googlegroups.com
Hello Jing An,

You can customize the background color of the dropdown div by creating a custom dropdown field subclass, and registering over the built in field.

You will want to override `showEditor` and call `dropdownDiv.setColour` with the colors you want.

```
override showEditor_(e) {
  super.showEditor_(e);
  dropdownDiv.setColour(/* my colour */);
}
```

I hope that helps! If you have any further questions please reply =)
--Beka

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/f1323bc5-e459-4557-8c80-29bd8c2ba9dan%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages