Skip to content

Commit bc17707

Browse files
committed
adds dark mode colors
1 parent b184e7f commit bc17707

File tree

3 files changed

+78
-33
lines changed

3 files changed

+78
-33
lines changed

src/theme/Admonition/Types.js

+27-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
11
import React from 'react';
22
import DefaultAdmonitionTypes from '@theme-original/Admonition/Types';
33
import BusinessIcon from '@mui/icons-material/Business';
4+
import {useColorMode} from '@docusaurus/theme-common';
45

5-
import './types.css';
6+
// import './types.css';
7+
import styles from './types.module.css';
68

79
function EnterpriseAdmonition(props) {
10+
const {colorMode} = useColorMode();
11+
812
return (
9-
<div className="custom_admonition">
10-
<div className="custom_admonition_header">
11-
<span><BusinessIcon style={{color: 'rgb(86 83 83)'}}/></span>
12-
<h5>{props.title}</h5>
13+
<div className={
14+
colorMode === 'dark'
15+
? styles.custom_admonition_dark_mode
16+
: styles.custom_admonition_light_mode
17+
}
18+
>
19+
<div className={styles.custom_admonition_header}>
20+
<span><BusinessIcon style={
21+
colorMode === 'dark'
22+
? {color: '#ECE5FF'}
23+
: {color: 'rgb(86 83 83)'}
24+
}/></span>
25+
<h5 className={
26+
colorMode === 'dark'
27+
? styles.custom_admonition_title_dark_mode
28+
: styles.custom_admonition_title_light_mode
29+
}>{props.title}</h5>
1330
</div>
14-
<div className="custom_admonition_text">
31+
<div className={
32+
colorMode === 'dark'
33+
? styles.custom_admonition_text_dark_mode
34+
: styles.custom_admonition_text
35+
}>
1536
<p>{props.children}</p>
1637
</div>
1738
</div>

src/theme/Admonition/types.css

-27
This file was deleted.

src/theme/Admonition/types.module.css

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.custom_admonition_light_mode {
2+
border: #ededed 1px solid;
3+
border-left: #6F43E7 solid 4px;
4+
border-radius: 10px;
5+
margin: 0 0 16px 0;
6+
padding: 16px;
7+
background-color: #f6f3ff;
8+
}
9+
10+
.custom_admonition_dark_mode {
11+
border: #612fea 1px solid;
12+
border-left: #e6bffa solid 4px;
13+
border-radius: 10px;
14+
margin: 0 0 16px 0;
15+
padding: 16px;
16+
background-color: #7161ef;
17+
}
18+
19+
.custom_admonition_header {
20+
display: flex;
21+
justify-content: flex-start;
22+
}
23+
24+
.custom_admonition_header span {
25+
margin-right: 5px;
26+
}
27+
28+
.custom_admonition_title_light_mode {
29+
color: #6F43E7;
30+
font-size: 16px;
31+
}
32+
33+
.custom_admonition_title_dark_mode {
34+
color: #ECE5FF;
35+
font-size: 16px;
36+
}
37+
38+
.custom_admonition_text p {
39+
margin: 0 0 0 0;
40+
font-size: 16px;
41+
}
42+
43+
.custom_admonition_text_dark_mode p {
44+
margin: 0 0 0 0;
45+
font-size: 16px;
46+
}
47+
48+
.custom_admonition_text_dark_mode a {
49+
color: #f1e8f9;
50+
font-weight: bold;
51+
}

0 commit comments

Comments
 (0)