Skip to content

Commit 4b65ff2

Browse files
authored
Merge pull request #3526 from ClickHouse/gingerwizard-patch-1
Update Image style guide
2 parents 178fd19 + e3f2300 commit 4b65ff2

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

contribute/style-guide.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,31 @@ keywords: [chdb, clickhouse-local]
7676
import clickhouse-local-1 from '@site/static/images/chdb/guides/clickhouse-local-1.png'
7777
import clickhouse-local-2 from '@site/static/images/chdb/guides/clickhouse-local-2.png'
7878
import clickhouse-local-3 from '@site/static/images/chdb/guides/clickhouse-local-3.png'
79+
import Image from '@theme/IdealImage';
7980
```
8081

81-
Use the `<img/>` tag to place your image in the appropriate place:
82+
To render images we use a fork of the IdealImage plugin. This generates multiple variants of an image, [asynchronously loading them as well as selecting the most appropriate based on the network connection](https://github.com/stereobooster/react-ideal-image/blob/master/introduction.md).
83+
84+
Ensure you import the `Image` component as shown above.
85+
86+
Use the `<Image/>` tag to place your image in the appropriate place:
8287

8388
```markdown
8489
Here is some example text which refers to the image below:
8590

86-
<img src={clickhouse-local-1}
87-
alt='DESCRIPTION OF THE IMAGE'
88-
style={{width: '800px'}} // optional
89-
/>
91+
<Image img={clickhouse-local-1} alt='DESCRIPTION OF THE IMAGE' size="md" border background="black"/>
9092

9193
Here is another paragraph...
9294
```
9395

96+
This component takes a number of props:
97+
98+
1. `img` - the imported image
99+
2. `alt` - mandatory alternate text specified
100+
3. `size` - either `lg` (width 1024px), `md` (width 600px), `sm` (width 300px) or `logo` (48x). This sets the maximum image size. Lower resolutions maybe used on smaller screens or slower connections.
101+
4. `border` - Applies a border. **Use for screenshots only.**
102+
5. `background` - either `white` or `black`. Applicable if your image is transparent. All new images must use `black`.
103+
94104
## Codeblocks
95105

96106
Codeblocks are defined using backticks. For example:

0 commit comments

Comments
 (0)