Skip to content

Commit ed993b1

Browse files
authored
Merge pull request #15 from marcop135/epic-elgamal-1d5cd0
feat(ui): bootstrap-icons header + larger monospace editor (v2.8.0)
2 parents ad150c4 + 7b0ca61 commit ed993b1

5 files changed

Lines changed: 57 additions & 27 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "md2pdf",
3-
"version": "2.7.6",
3+
"version": "2.8.0",
44
"description": "Offline Markdown to PDF in the browser. No server, no uploads.",
55
"keywords": [
66
"markdown",
@@ -27,6 +27,7 @@
2727
"nonaction": "^0.0.5",
2828
"normalize.css": "^8.0.1",
2929
"react": "^19.2.4",
30+
"react-bootstrap-icons": "^1.11.6",
3031
"react-dom": "^19.2.4",
3132
"react-helmet": "^6.1.0",
3233
"react-markdown": "^10.1.0",

src/App/Components/Header/Upload.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { useProvided } from 'nonaction';
3+
import { FileEarmarkArrowUpFill } from 'react-bootstrap-icons';
34
import { TextContainer } from '../../Container';
45

56
export default (props) => {
@@ -56,9 +57,7 @@ export default (props) => {
5657
cursor: 'pointer',
5758
}}
5859
/>
59-
<span role="img" aria-label="upload">
60-
⬆️
61-
</span>
60+
<FileEarmarkArrowUpFill size={18} aria-label="Import .md file" />
6261
<span>Import .md file</span>
6362
</p>
6463
);

src/App/Components/Header/index.js

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import styled from 'styled-components';
33
import { Helmet } from 'react-helmet';
4+
import { FileEarmarkPdfFill } from 'react-bootstrap-icons';
45
import UploadButton from './Upload.js';
56
import { waitForMermaidRenders } from '../Markdown/Previewer/Mermaid.jsx';
67
import packageMeta from '../../../../package.json';
@@ -36,10 +37,8 @@ const Header = ({ className }) => {
3637

3738
<div className="menu">
3839
<UploadButton className="button upload" />
39-
<p className="button download" onClick={onTransfrom} tabIndex={0}>
40-
<span role="img" aria-label="download">
41-
⬇️
42-
</span>
40+
<p className="button download primary" onClick={onTransfrom} tabIndex={0}>
41+
<FileEarmarkPdfFill size={18} aria-label="Export to PDF" />
4342
<span>Export to .pdf</span>
4443
</p>
4544
</div>
@@ -57,19 +56,28 @@ export default styled(Header)`
5756
overflow: auto;
5857
-webkit-overflow-scrolling: touch;
5958
user-select: none;
60-
padding: 0 5px;
61-
color: black;
62-
background-color: rgb(233, 233, 233);
59+
padding: 0 12px;
60+
color: #1f2328;
61+
background-color: #f6f8fa;
62+
border-bottom: 1px solid #d0d7de;
6363
display: flex;
6464
align-items: center;
65-
height: 40px;
65+
height: 48px;
6666
6767
.project {
68-
font-weight: bold;
68+
font-weight: 600;
69+
font-size: 15px;
70+
letter-spacing: 0.2px;
6971
margin: 5px;
7072
flex-shrink: 0;
7173
height: 20px;
7274
75+
small {
76+
margin-left: 4px;
77+
color: #6c757d;
78+
font-weight: 400;
79+
}
80+
7381
@media (max-width: 420px) {
7482
small {
7583
display: none;
@@ -85,40 +93,48 @@ export default styled(Header)`
8593
justify-content: flex-end;
8694
8795
.button {
88-
height: 75%;
96+
height: 32px;
8997
min-width: 60px;
9098
display: flex;
9199
align-items: center;
92100
margin-left: 8px;
93-
padding: 0 10px;
94-
border: 1px solid rgb(53, 123, 253);
95-
border-radius: 5px;
101+
padding: 0 12px;
102+
font-size: 14px;
103+
border: 1px solid #d0d7de;
104+
border-radius: 6px;
96105
cursor: pointer;
97-
background-color: #cde4fe;
106+
background-color: #ffffff;
107+
color: #1f2328;
98108
transition:
99-
background-color 0.2s ease,
100-
transform 0.2s ease;
109+
background-color 0.15s ease,
110+
border-color 0.15s ease,
111+
transform 0.15s ease;
101112
102113
@media (max-width: 600px) {
103-
span + span {
114+
svg + span {
104115
display: none;
105116
}
106-
span[role='img'] {
117+
svg {
107118
margin: auto !important;
108-
padding: 0 !important;
109119
}
110120
}
111121
112122
&:hover {
113-
background-color: #eaf4ff;
123+
background-color: #f6f8fa;
124+
border-color: #afb8c1;
114125
}
115126
116127
&:active {
117128
transform: scale(0.97);
118129
}
119130
120-
span[role='img'] {
121-
margin-right: 5px;
131+
&.primary svg {
132+
color: rgb(53, 123, 253);
133+
}
134+
135+
svg {
136+
margin-right: 6px;
137+
flex-shrink: 0;
122138
}
123139
}
124140
}

src/App/Components/Markdown/Editor/MirrorEditor.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ export default styled(Editor)`
3434
}
3535
3636
.cm-scroller {
37-
line-height: 1.5;
37+
line-height: 1.6;
38+
font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
39+
'Liberation Mono', monospace;
40+
font-size: 15px;
41+
}
42+
43+
.cm-gutters {
44+
font-size: 13px;
3845
}
3946
`;

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4723,6 +4723,13 @@ punycode@^2.1.0, punycode@^2.3.1:
47234723
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
47244724
integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==
47254725

4726+
react-bootstrap-icons@^1.11.6:
4727+
version "1.11.6"
4728+
resolved "https://registry.yarnpkg.com/react-bootstrap-icons/-/react-bootstrap-icons-1.11.6.tgz#211b58b2f2b32a624c4f5b24b9a4dae8df3d3268"
4729+
integrity sha512-ycXiyeSyzbS1C4+MlPTYe0riB+UlZ7LV7YZQYqlERV2cxDiKtntI0huHmP/3VVvzPt4tGxqK0K+Y6g7We3U6tQ==
4730+
dependencies:
4731+
prop-types "^15.7.2"
4732+
47264733
react-dom@^19.2.4:
47274734
version "19.2.4"
47284735
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.2.4.tgz#6fac6bd96f7db477d966c7ec17c1a2b1ad8e6591"

0 commit comments

Comments
 (0)