Stay organized with collections
Save and categorize content based on your preferences.
blockly > blockRendering > ConstantProvider > getBlockStyle
blockRendering.ConstantProvider.getBlockStyle() method
Gets the BlockStyle for the given block style name.
Signature:
getBlockStyle(blockStyleName: string | null): BlockStyle;
Parameters
Parameter |
Type |
Description |
blockStyleName |
string | null |
The name of the block style. |
Returns:
BlockStyle
The named block style, or a default style if no style with the given name was found.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `getBlockStyle` method retrieves the visual style (BlockStyle) associated with a given block style name."],["If a block style with the specified name isn't found, a default style is returned instead."],["It accepts a single argument, `blockStyleName`, which is either a string representing the style name or null."]]],["The `getBlockStyle()` method retrieves a `BlockStyle` object based on a provided `blockStyleName` (a string or null). It takes the style name as a parameter. If a style with the given name exists, it is returned; otherwise, a default style is provided. The method's return type is `BlockStyle`. This function is part of the `ConstantProvider` class within the `blockRendering` namespace.\n"]]