This is a feature request. When people start to create themes for Scratch 3 they'll want a way to distinguish the inputs from the blocks themselves with CSS styles. It'd be nice if there was a class-name on the paths to separate the two.
Sounds like a nice idea to me so Scratchers could customize how things look with user-styles :)
We should definitely wait until we play out #238, since that would restructure how things are arranged.
Whenever y'all revisit this, consider adding classes to distinguish block shape and category as well. That'll make creating themes/skins significantly easier.
On a deeply nested stack of blocks, adding the class to each block may be
an expensive operation.
On Fri, Jun 10, 2016 at 8:26 PM Airhogs777 [email protected] wrote:
Whenever y'all revisit this, consider adding classes to distinguish block
shape and category as well. That'll make creating themes/skins
significantly easier.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/LLK/scratch-blocks/issues/365#issuecomment-225334184,
or mute the thread
https://github.com/notifications/unsubscribe/ANDWfy5HRjFdU-CAcbHkc9OTy3qKusxkks5qKirWgaJpZM4IuBtE
.
I've been thinking about how to do this. Shape classes could be added on the fly during rendering/initialization based on connections.
Category isn't as easy to determine. I see a few options:
{"#FFFFFF": "categoryName"}. But that seems like overkill...Sometime down the line, would you guys be willing to accept a PR that adds this functionality?
Regarding category: I would personally lean toward option 3 (adding category names to block definitions) for exactly the reason you say. The color-boilerplate reduction would possibly be worth the addition regardless of making it easier to user-style the blocks. In fact, if we went this route, we could set the colors of blocks entirely through CSS on the category name and throw out the Blockly.Colours dictionary for blocks. That's not how Blockly approaches the color problem right now, but I think we could entertain it.
Have you guys discussed #238 at all? I'd be willing to get started on a pull request to add the block shape class code.
Hey @Airhogs777! We have discussed it. It's looking like it might happen, but might take some time. So it might be best to wait before adding the class code.
Those were all the changes I was hoping for. Thanks for being so open to my contributions! :)
Most helpful comment
Regarding category: I would personally lean toward option 3 (adding category names to block definitions) for exactly the reason you say. The color-boilerplate reduction would possibly be worth the addition regardless of making it easier to user-style the blocks. In fact, if we went this route, we could set the colors of blocks entirely through CSS on the category name and throw out the Blockly.Colours dictionary for blocks. That's not how Blockly approaches the color problem right now, but I think we could entertain it.