Skip to content

Commit 059a9c7

Browse files
committed
chore(docs): replace CompareBlock component with admonition syntax
1 parent 541c8d6 commit 059a9c7

4 files changed

Lines changed: 38 additions & 98 deletions

File tree

packages/docs/docs/guides/app-integration/attribution.mdx

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ image: images/blockly_banner.png
66

77
import Image from '@site/src/components/Image';
88

9-
<head>
10-
<link
11-
href="https://fonts.googleapis.com/icon?family=Material+Icons"
12-
rel="stylesheet"
13-
/>
14-
</head>
15-
169
# Attribute Blockly
1710

1811
Blockly's code is open source and free to use without attribution.
@@ -46,18 +39,16 @@ press interviews, the app, and on your website.
4639

4740
### Reference do's and don'ts
4841

49-
<p>
50-
<span className="compare-better">Do</span> — Call Blockly "beginner friendly"
51-
instead of "kid friendly." Blockly is used for a variety of applications, not
52-
all of which are kid focused.
53-
</p>
42+
:::tip[Do]
43+
Call Blockly "beginner friendly" instead of "kid friendly." Blockly is used for
44+
a variety of applications, not all of which are kid focused.
45+
:::
5446

55-
<p>
56-
<span className="compare-worse">Don't</span> — Refer to Blockly as a language
57-
(for example, as a "block-based programming language"). Blockly is not a
58-
language, it's a library that developers use to make a block-based visual
59-
programming interface.
60-
</p>
47+
:::danger[Don't]
48+
Refer to Blockly as a language (for example, as a "block-based programming
49+
language"). Blockly is not a language, it's a library that developers use to
50+
make a block-based visual programming interface.
51+
:::
6152

6253
## How to visually represent Blockly
6354

@@ -324,7 +315,7 @@ element on your page.
324315
Never crowd or overlap the logo with other elements.
325316
</p>
326317
<h3>Common errors</h3>
327-
<span className="compare-worse">Do not...</span>
318+
<b>Do not...</b>
328319
<ul>
329320
<li>Alter or distort the logo in any way</li>
330321
<li>Use the white knockout in any color but white</li>

packages/docs/docs/guides/contribute/samples/block_libraries.mdx

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ title: Publish block libraries
44
image: images/blockly_banner.png
55
---
66

7-
import Head from '@docusaurus/Head';
8-
import CompareBlock from '@site/src/components/CompareBlock';
9-
10-
<Head>
11-
<link
12-
href="https://fonts.googleapis.com/icon?family=Material+Icons"
13-
rel="stylesheet"
14-
/>
15-
</Head>
16-
17-
187
# Publish block libraries
198

209
Plugins that provide libraries of block definitions are a great way to share
@@ -42,35 +31,34 @@ versatile and useful as possible, we've developed these guidelines.
4231
pieces they need without worrying that pieces they don't will be
4332
installed.
4433
- Use the JSON field registry instead of instantiating new fields directly.
45-
46-
- <CompareBlock variant="worse">
47-
Not Recommended - Instantiating a new field directly:
48-
49-
```js
50-
const myCustomBlock = {
51-
init: function() {
52-
this.appendDummyInput()
53-
.appendField(new Blockly.FieldNumber(123), 'NAME');
54-
}
55-
}
56-
```
57-
</CompareBlock>
58-
59-
- <CompareBlock variant="better">
60-
Recommended - JSON field registry:
61-
62-
```js
63-
export const myCustomBlock = {
64-
init: function() {
65-
this.appendDummyInput()
66-
.appendField(Blockly.fieldRegistry.fromJson({
67-
name: 'field_number',
68-
value: 123,
69-
}), 'NAME');
70-
}
71-
}
72-
```
73-
</CompareBlock>
34+
:::danger[Not Recommended]
35+
Instantiating a new field directly:
36+
37+
```js
38+
const myCustomBlock = {
39+
init: function() {
40+
this.appendDummyInput()
41+
.appendField(new Blockly.FieldNumber(123), 'NAME');
42+
}
43+
}
44+
```
45+
:::
46+
47+
:::tip[Recommended]
48+
Use the JSON field registry:
49+
50+
```js
51+
export const myCustomBlock = {
52+
init: function() {
53+
this.appendDummyInput()
54+
.appendField(Blockly.fieldRegistry.fromJson({
55+
name: 'field_number',
56+
value: 123,
57+
}), 'NAME');
58+
}
59+
}
60+
```
61+
:::
7462

7563
- Using the field registry makes it easier for a user to replace the
7664
implementation of the field used in your block without having to change

packages/docs/src/components/CompareBlock.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/docs/src/css/custom.css

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -270,40 +270,6 @@ table th p {
270270
transform: scale(1.05);
271271
}
272272

273-
.compare-better:before {
274-
content: 'thumb_up';
275-
color: #1e8e3e;
276-
font-family: 'Material Icons' !important;
277-
font-weight: normal;
278-
font-style: normal;
279-
font-size: 24px;
280-
margin-inline: 0 4px;
281-
vertical-align: middle;
282-
width: 24px;
283-
}
284-
285-
.compare-worse:before {
286-
content: 'thumb_down';
287-
color: #d50000;
288-
font-family: 'Material Icons' !important;
289-
font-weight: normal;
290-
font-style: normal;
291-
font-size: 24px;
292-
margin-inline: 0 4px;
293-
vertical-align: middle;
294-
width: 24px;
295-
}
296-
297-
.compare-better,
298-
.compare-worse {
299-
font-weight: 700;
300-
}
301-
302-
.compare-better p,
303-
.compare-worse p {
304-
margin-top: 0;
305-
}
306-
307273
.appendInputImg {
308274
width: 145px !important;
309275
}

0 commit comments

Comments
 (0)