Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/blockly/core/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Grid {
* @param pattern The grid's SVG pattern, created during injection.
* @param options A dictionary of normalized options for the grid.
* See grid documentation:
* https://developers.google.com/blockly/guides/configure/web/grid
* https://developers.google.com/blockly/guides/configure/grid
*/
constructor(
private pattern: SVGElement,
Expand Down
6 changes: 3 additions & 3 deletions packages/blockly/core/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export class Options {
/**
* Parse the user-specified zoom options, using reasonable defaults where
* behaviour is unspecified. See zoom documentation:
* https://developers.google.com/blockly/guides/configure/web/zoom
* https://developers.google.com/blockly/guides/configure/zoom
*
* @param options Dictionary of options.
* @returns Normalized zoom options.
Expand Down Expand Up @@ -304,7 +304,7 @@ export class Options {
/**
* Parse the user-specified grid options, using reasonable defaults where
* behaviour is unspecified. See grid documentation:
* https://developers.google.com/blockly/guides/configure/web/grid
* https://developers.google.com/blockly/guides/configure/grid
*
* @param options Dictionary of options.
* @returns Normalized grid options.
Expand All @@ -322,7 +322,7 @@ export class Options {

/**
* Parse the user-specified theme options, using the classic theme as a
* default. https://developers.google.com/blockly/guides/configure/web/themes
* default. https://developers.google.com/blockly/guides/configure/appearance/themes
*
* @param options Dictionary of options.
* @returns A Blockly Theme.
Expand Down
2 changes: 1 addition & 1 deletion packages/blockly/tests/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ <h1>Blockly Playground</h1>
</ul>

<!-- The next three blocks of XML are sample toolboxes for testing basic
configurations. For more information on building toolboxes, see https://developers.google.com/blockly/guides/configure/web/toolbox -->
configurations. For more information on building toolboxes, see https://developers.google.com/blockly/guides/configure/toolboxes/toolbox -->

<!-- toolbox-simple is an always-open flyout with no category menu.
Always-open flyouts are a good idea if you have a small number of blocks. -->
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/docs/codelabs/context-menu-option/summary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ In this codelab you have learned how to create and modify context menu options.

### Additional information

- [Context menu documentation](/guides/configure/web/context-menus)
- [Context menu documentation](/guides/configure/context-menus)

- You can also define [block context menus](/guides/configure/web/context-menus#customize-per-block) directly on a block definition, which is equivalent to adding a precondition based on the type of the block.
- You can also define [block context menus](/guides/configure/context-menus#customize-per-block) directly on a block definition, which is equivalent to adding a precondition based on the type of the block.
2 changes: 1 addition & 1 deletion packages/docs/docs/codelabs/css/blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The last step before writing your colour rules is to decide what colours to use.
How these colours are used depends on the renderer. The Thrasos renderer uses
the primary colour as the `fill` of the block, the tertiary colour as the
`stroke`, and the secondary colour as the `fill` when the block is a
[shadow block](/guides/configure/web/toolboxes/preset#shadow-blocks).
[shadow block](/guides/configure/toolboxes/preset#shadow-blocks).

#### Add your rules

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/codelabs/css/categories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ define rules that apply to all categories.
},
```

For a complete explanation of how `cssConfig` works, see [Custom CSS classes](/guides/configure/web/toolboxes/appearance#custom-css-classes) in the toolbox documentation.
For a complete explanation of how `cssConfig` works, see [Custom CSS classes](/guides/configure/toolboxes/appearance#custom-css-classes) in the toolbox documentation.

### Add your rules

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/codelabs/css/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ You might have also noticed that some rules use an `!important` declaration whil

- **Inline styles:** These rules are included via a `style` attribute and can only be overridden by an `!important` declaration. As you will see later, the colour of the arrow in a dropdown field is set with an inline style and must be overridden with `!important`.

The easiest way to determine how a rule is set is to highlight the appropriate element in the element inspector and look at the corresponding style information. In a few cases, this isn't possible. For example, an insertion marker is created only when you drag a child near its parent and is deleted when you let go of the parent to highlight the insertion marker's element. In these cases, you will need to [search Blockly's rules](/guides/configure/web/appearance/css#blockly-css-rules).
The easiest way to determine how a rule is set is to highlight the appropriate element in the element inspector and look at the corresponding style information. In a few cases, this isn't possible. For example, an insertion marker is created only when you drag a child near its parent and is deleted when you let go of the parent to highlight the insertion marker's element. In these cases, you will need to [search Blockly's rules](/guides/configure/appearance/css#blockly-css-rules).
2 changes: 1 addition & 1 deletion packages/docs/docs/codelabs/css/summary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ description: Summary of the CSS in Blockly codelab

In this codelab, you learned how to use CSS to set the colours of your Blockly editor.

For more information, see [Style with CSS](/guides/configure/web/appearance/css) in the Blockly user guides.
For more information, see [Style with CSS](/guides/configure/appearance/css) in the Blockly user guides.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ to be:
```

All the classes used to create a category can be set similar to how we set the
icon class above. See the [Blockly toolbox documentation](/guides/configure/web/toolboxes/appearance#category-css) for more information.
icon class above. See the [Blockly toolbox documentation](/guides/configure/toolboxes/appearance#category-css) for more information.

### Add some CSS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The logic_category style looks like:
}
```

For more information on Blockly styles please visit the [themes documentation](/guides/configure/web/appearance/themes#category-style).
For more information on Blockly styles please visit the [themes documentation](/guides/configure/appearance/themes#category-style).

### Add some CSS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ The code samples are written in ES6 syntax. You can find the code for the [compl
- A browser.
- A text editor.
- Basic knowledge of HTML, CSS, and JavaScript.
- Basic understanding of the [Blockly toolbox](/guides/configure/web/toolboxes/toolbox).
- Basic understanding of the [Blockly toolbox](/guides/configure/toolboxes/toolbox).

Throughout various parts of this codelab we will be talking about [toolbox definitions](/guides/configure/web/toolboxes/category?tab=xml).
Throughout various parts of this codelab we will be talking about [toolbox definitions](/guides/configure/toolboxes/category?tab=xml).
The toolbox definition can be written in XML or JSON. We will be using an XML
toolbox definition that can be found in the provided code.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The toolbox may be organized into categories, and may contain both single blocks

A toolbox is defined as a JavaScript object and passed into the workspace constructor through an options struct.

For more information on this JSON format and toolbox configuration, including category creation, please see our <a href="/guides/configure/web/toolboxes/toolbox">toolbox documentation</a>.
For more information on this JSON format and toolbox configuration, including category creation, please see our <a href="/guides/configure/toolboxes/toolbox">toolbox documentation</a>.

### Define the toolbox

Expand Down Expand Up @@ -92,7 +92,7 @@ Let's look at the options we used to initialize your blockly editor:
- `horizontalLayout`: Whether to display the toolbox horizontally or vertically in the workspace.
- `toolboxPosition`: Whether to show the toolbox at the top or bottom of the workspace.

The `options` struct gives you significant control over your Blockly instance. You can pass options to set Blockly's theme, modify scrolling behaviour, set the renderer, and more. For more information, head over to Blockly's developer site and check out the [configuration](/guides/configure/web/configuration_struct#the-options-dictionary) section.
The `options` struct gives you significant control over your Blockly instance. You can pass options to set Blockly's theme, modify scrolling behaviour, set the renderer, and more. For more information, head over to Blockly's developer site and check out the [configuration](/guides/configure/configuration_struct#the-options-dictionary) section.

### Check your work

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: How to use a theme to set the colours of blocks.

A block style currently only holds three different colour properties. They are 'colourPrimary',
'colourSecondary' and 'colourTertiary'. This value can either be defined as a hex value or as a hue.
For more information on block styles visit our themes [documentation](/guides/configure/web/appearance/themes#block-style)
For more information on block styles visit our themes [documentation](/guides/configure/appearance/themes#block-style)

Update the Theme definition to have the block styles as below.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ In this codelab you have learned how to extend and customize themes for the bloc

### Additional information

- [Themes documentation](/guides/configure/web/appearance/themes)
- [Themes documentation](/guides/configure/appearance/themes)

- You can also customize the font styles. Details are available in the [documentation](/guides/configure/web/appearance/themes#font-styles).
- You can also customize the font styles. Details are available in the [documentation](/guides/configure/appearance/themes#font-styles).
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ You can find the code for the [completed custom block](https://github.com/Raspbe
- A browser.
- A text editor.
- Basic knowledge of JavaScript.
- Basic understanding of the [Blockly toolbox](/guides/configure/web/toolboxes/toolbox).
- Basic understanding of the [Blockly toolbox](/guides/configure/toolboxes/toolbox).
- Basic understanding of [using JSON to define custom blocks](/guides/create-custom-blocks/define/structure-json).
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ You can find the code for the [completed custom block](https://github.com/Raspbe

For more information related topics, check out the documentation:

- [Defining the toolbox](/guides/configure/web/toolboxes/toolbox)
- [Defining the toolbox](/guides/configure/toolboxes/toolbox)
- [Defining custom blocks](/guides/create-custom-blocks/overview)
- [Generating code from blocks](/guides/create-custom-blocks/code-generation/overview)
- [Creating extensions](/guides/create-custom-blocks/define/extensions#extensions)
- [Listening for change events](/guides/configure/web/events)
- [Listening for change events](/guides/configure/events)
- [Custom validators](/guides/create-custom-blocks/fields/validators)
- [Custom block style guide](/guides/design/blocks)
2 changes: 1 addition & 1 deletion packages/docs/docs/guides/app-integration/run-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,5 @@ safely execute JavaScript.

Other languages require other tools.

[event]: /guides/configure/web/events
[event]: /guides/configure/events
[jsinterpreter]: https://github.com/NeilFraser/JS-Interpreter
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ with the colours mirrored by the various toolbar categories in the demos:
colour.](/images/standard-block-colors.png)

Additional colours on the block are derived from the main colour. For example,
[shadow blocks](/guides/configure/web/toolboxes/preset#shadow-blocks)
[shadow blocks](/guides/configure/toolboxes/preset#shadow-blocks)
are a desaturated version of the main colour, and border colours are a darker
version.

:::tip
If you want more control over shadow block or border colours, learn about
[defining a theme](/guides/configure/web/appearance/themes).
[defining a theme](/guides/configure/appearance/themes).
:::

## Set block colour

The primary colour of a block can be defined in either JSON or JavaScript. You
can pass the hue (preferred), RGB value, or color name; for more information,
see [Colour formats](/guides/configure/web/appearance/colour-formats).
see [Colour formats](/guides/configure/appearance/colour-formats).

<Tabs groupId="group-1">
<TabItem value="json" label="JSON" default>
Expand All @@ -54,10 +54,10 @@ Note the British spelling. Failure to set the colour results in a black block.

You can also set the block color using the
[`Block.setColour(..)`](/reference/blockly.block.setcolour)
function, or by using [themes](/guides/configure/web/appearance/themes)
function, or by using [themes](/guides/configure/appearance/themes)
and defining a block style.

## Accessibility

For information about how colour affects accessibility, see [Colour and
accessibility](/guides/configure/web/colour-a11y)
accessibility](/guides/configure/colour-a11y)
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ W3C](https://www.w3.org/TR/css-color-3/#html4).
Often, multiple blocks share the same colour, and centralizing the colour
definitions simplifies managing the colours and adding new blocks of the correct
colour. Block colours and toolbox categories can use [localization
tokens](/guides/configure/web/translations#use-localization-tokens-in-json)
tokens](/guides/configure/translations#use-localization-tokens-in-json)
to do exactly that.

Blockly includes nine colour constants in the string table, corresponding to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can use CSS to style your application:
For a practical introduction to using CSS in blockly, see the [Use CSS in Blockly](/codelabs/css/codelab-overview)

:::note
The easiest way to style Blockly is with [themes](/guides/configure/web/appearance/themes). If you need finer-grained control, use CSS.
The easiest way to style Blockly is with [themes](/guides/configure/appearance/themes). If you need finer-grained control, use CSS.
:::

## CSS classes
Expand Down Expand Up @@ -67,12 +67,12 @@ To add or remove a CSS class from a workspace's injection `<div>`, call

To add a CSS class to a button or a label in a toolbox, use the `web-class` key
in your JSON definition of the toolbox. For more information, see [Buttons and
labels](/guides/configure/web/toolboxes/buttons).
labels](/guides/configure/toolboxes/buttons).

To override the CSS classes used for the various parts of a category, use the
`cssConfig` key in your JSON definition of the category. This allows you to
style individual categories. For more information, see [Category
CSS](/guides/configure/web/toolboxes/appearance#category-css).
CSS](/guides/configure/toolboxes/appearance#category-css).

#### Blocks

Expand Down Expand Up @@ -294,7 +294,7 @@ tag. The rules in this tag come from:
`Blockly.css.register`](https://github.com/search?q=repo%3ARaspberryPiFoundation%2Fblockly+css.register+path%3Acore&type=code).

If you do not want to use these rules, set the [`css` configuration
option](/guides/configure/web/configuration_struct#the-options-dictionary)
option](/guides/configure/configuration_struct#the-options-dictionary)
to `false`. In this case, you are responsible for providing an alternate set of
CSS rules.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ empower developers to create Blockly experiences that are more accessible.
For a practical introduction to using themes, see the [Customizing your themes](/codelabs/theme-extension-identifier/codelab-overview)

:::note
The easiest way to style Blockly is with themes. If you need finer-grained control, use [CSS](/guides/configure/web/appearance/css).
The easiest way to style Blockly is with themes. If you need finer-grained control, use [CSS](/guides/configure/appearance/css).
:::

:::note
If you only want to control the main colour of a block, rather than have
more fine-grained control over the appearance, you can set the colour in the
[block definition](/guides/configure/web/appearance/block-colour#set-block-colour)
[block definition](/guides/configure/appearance/block-colour#set-block-colour)
instead of creating a theme. If you want to change the shape of a block instead
of its colour, learn more about
[renderers](/guides/create-custom-blocks/renderers/overview).
Expand Down Expand Up @@ -177,7 +177,7 @@ Learn more about the use cases of start hats on our
If you set `startHats: true` directly in a theme object, a hat will be added to
all blocks with no previous or output connections. If you want more control over
exactly which blocks get a hat, you can instead use the
[block style](/guides/configure/web/appearance/themes/#block-style) property.
[block style](/guides/configure/appearance/themes/#block-style) property.

## Custom Themes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ of the block (such as whether it is editable or collapsed) or the setting of the
`comments` configuration option.

[editable]: /guides/create-custom-blocks/define/block-state#editable-state
[config-option]: /guides/configure/web/configuration_struct#the-options-dictionary
[config-option]: /guides/configure/configuration_struct#the-options-dictionary
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ text on the block, and so not a critical attribute. However, when choosing a
block colour palette, colour blindness should be a consideration.

Blockly provides [several
themes](/guides/configure/web/appearance/themes#built-in) in an effort
themes](/guides/configure/appearance/themes#built-in) in an effort
to accommodate some types of colour vision deficiency. [This
page](http://mkweb.bcgsc.ca/colorblind/palettes.mhtml#projecthome) includes
example 8, 12, 15, and 24 colour palettes that attempt to maximize distinction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ default value based on whether the provided toolbox has categories or not.
| `trashcan` | boolean | Displays or hides the trashcan. Defaults to `true` if the toolbox has categories, `false` otherwise. |
| `zoom` | object | Configures zooming behaviour. See [Zoom]. |

[Grid]: /guides/configure/web/grid
[media]: /guides/configure/web/media
[Move]: /guides/configure/web/move
[Grid]: /guides/configure/grid
[media]: /guides/configure/media
[Move]: /guides/configure/move
[setIsReadOnly]: /reference/blockly.workspace.setisreadonly
[isReadOnly]: /reference/blockly.workspace.isreadonly
[renderer]: /guides/create-custom-blocks/renderers/create-custom-renderers/basic-implementation
[RTL demo]: https://raspberrypifoundation.github.io/blockly-samples/examples/rtl-demo/
[Themes]: /guides/configure/web/appearance/themes
[defining the toolbox]: /guides/configure/web/toolboxes/toolbox
[Zoom]: /guides/configure/web/zoom
[replacement]: /guides/configure/web/customization#injecting-subclasses
[Themes]: /guides/configure/appearance/themes
[defining the toolbox]: /guides/configure/toolboxes/toolbox
[Zoom]: /guides/configure/zoom
[replacement]: /guides/configure/customization#injecting-subclasses
Loading
Loading