Skip to content

Commit 371e5ef

Browse files
committed
simplify dark mode styling
1 parent aaf40ca commit 371e5ef

File tree

3 files changed

+43
-81
lines changed

3 files changed

+43
-81
lines changed

src/theme/Admonition/Types.js

+6-30
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,16 @@
1-
import React from 'react';
21
import DefaultAdmonitionTypes from '@theme-original/Admonition/Types';
32
import BusinessIcon from '@mui/icons-material/Business';
4-
import {useColorMode} from '@docusaurus/theme-common';
53

6-
// import './types.css';
7-
import styles from './types.module.css';
4+
import styles from './styles.module.css';
85

96
function EnterpriseAdmonition(props) {
10-
const {colorMode} = useColorMode();
11-
127
return (
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>
30-
</div>
31-
<div className={
32-
colorMode === 'dark'
33-
? styles.custom_admonition_text_dark_mode
34-
: styles.custom_admonition_text
35-
}>
36-
<p>{props.children}</p>
8+
<div className={styles.enterprise}>
9+
<div className={styles.enterprise_header}>
10+
<BusinessIcon />
11+
<h5>{props.title}</h5>
3712
</div>
13+
{props.children}
3814
</div>
3915
);
4016
}
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.enterprise {
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+
[data-theme='dark'] .enterprise {
10+
border-color: #612fea;
11+
border-left-color: #ece5ff;
12+
background-color: #7161ef;
13+
}
14+
15+
.enterprise > :last-child {
16+
margin-bottom: 0;
17+
}
18+
19+
.enterprise_header {
20+
display: flex;
21+
align-items: center;
22+
margin-bottom: 1em;
23+
}
24+
25+
.enterprise_header h5 {
26+
margin: 0 5px;
27+
font-size: 16px;
28+
color: #6F43E7;
29+
}
30+
[data-theme='dark'] .enterprise_header h5 {
31+
color: #ECE5FF;
32+
}
33+
34+
[data-theme='dark'] .enterprise a {
35+
color: #f1e8f9;
36+
font-weight: bold;
37+
}

src/theme/Admonition/types.module.css

-51
This file was deleted.

0 commit comments

Comments
 (0)