Skip to content

Commit c8fce69

Browse files
committed
Finalize new design
1 parent c8ee02d commit c8fce69

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

src/app/globals.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body {
1313
220deg,
1414
$color-yellow-50,
1515
$color-purple-50,
16-
$color-black,
16+
$color-black
1717
); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
1818
font-family: var(--font-text), sans-serif;
1919
}

src/components/Content/Content.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Markdown from 'markdown-to-jsx';
88
import { highlighter } from '@/components/Generator/GeneredTaskfile/Highlighter';
99
import Link from 'next/link';
1010
import { usePathname } from 'next/navigation';
11+
import SaveFile from '@/components/Generator/GeneredTaskfile/SaveFile';
1112

1213
const links = [
1314
{ href: '/docs', label: 'About Taskfile' },
@@ -41,7 +42,12 @@ const Content = ({ content }: WindowProps): ReactElement => {
4142
className={styles.content}
4243
options={{
4344
overrides: {
44-
pre: (original) => <pre>{highlighter(original.children.props.children)}</pre>,
45+
pre: (original) => (
46+
<pre>
47+
<SaveFile content={original.children.props.children} className={styles.preSave} />
48+
{highlighter(original.children.props.children)}
49+
</pre>
50+
),
4551
img: ({ alt, src }) => <img className={styles.image} src={src.replace('public/', '/')} alt={alt} />,
4652
a: ({ href, props, children }) => {
4753
if (href.includes('.md')) {

src/components/Content/content.module.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@
7474
}
7575

7676
pre {
77+
position: relative;
7778
padding: 1rem;
7879
font-size: 0.8rem;
7980
background: rgba(16, 0, 31, 0.87);
8081
border-radius: 0.5rem;
82+
overflow: hidden;
8183
}
8284

8385
code {
@@ -86,12 +88,13 @@
8688
padding: 0.2rem;
8789
border-radius: 0.2rem;
8890
}
91+
}
8992

90-
img {
91-
border-radius: 0.5rem;
92-
}
93+
.content .preSave {
94+
top: 1rem;
9395
}
9496

9597
.image {
9698
max-width: 100%;
99+
border-radius: 0.5rem;
97100
}

src/components/Generator/GeneredTaskfile/SaveFile/SaveFile.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import styles from './save-file.module.scss';
66

77
type SaveFileProps = {
88
content: string;
9+
className?: string;
910
};
1011

11-
const SaveFile = ({ content }: SaveFileProps): ReactElement => {
12+
const SaveFile = ({ content, className = '' }: SaveFileProps): ReactElement => {
1213
const [isCopied, setCopied] = useState(false);
1314

1415
const copyToClipboard = (): void => {
@@ -29,7 +30,7 @@ const SaveFile = ({ content }: SaveFileProps): ReactElement => {
2930
};
3031

3132
return (
32-
<div className={styles.container}>
33+
<div className={`${styles.container} ${className}`}>
3334
<button type="button" className={styles.download} onClick={download} title="Download Taskfile" />
3435
<button
3536
type="button"

src/style/variables/_color.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ $color-white: #fff;
44

55
$color-blue-50: #0068bc;
66

7-
$color-purple-50: #5D4CB6;
7+
$color-purple-50: #5d4cb6;
88
$color-purple-10: color.adjust($color-purple-50, $lightness: 40%);
99

10-
$color-black: #221D3D;
10+
$color-black: #221d3d;
1111

1212
$color-yellow-50: #f2a900;
1313
$color-yellow-80: color.adjust($color-yellow-50, $lightness: -30%);

0 commit comments

Comments
 (0)