
For my new content, got to @codingmadlad
CHECK OUT MY FREE TEMPLATES →
Joined April 2023
- Tweets6.2K
- Following319
- Followers760
- Likes20.9K
🚨 MY ECOMMERCE STORE TEMPLATE HAS JUST BEEN DROPPED! 🚨
And I need your help to make my first website template a success.
Go to ProductHunt and Upvote my template!
producthunt.com/posts/ecomme…
It doesn't take much coding knowledge to turn Notion into a CMS.
Drop me a DM if you want the Code.
landing.madlad.store/ecommer…
2
89
Replying to @bzagrodzki
Assuming you're using the same style as Vercel.
You could use shiki.
CSS - index.css
:root {
--editor-padding: 16px 16px 21px 16px;
--shiki-foreground: hsla(0, 0%, 9%,1);
--shiki-token-constant: oklch(53.18% 0.2399 256.9900584162342);
--shiki-token-string: oklch(51.75% 0.1453 147.65);
--shiki-token-comment: hsla(0, 0%, 40%,1);
--shiki-token-keyword: oklch(53.5% 0.2058 2.84);
--shiki-token-parameter: oklch(52.79% 0.1496 54.65);
--shiki-token-function: oklch(47.18% 0.2579 304);
--shiki-token-string-expression: oklch(51.75% 0.1453 147.65);
--shiki-token-punctuation: hsla(0, 0%, 9%,1);
--shiki-token-link: oklch(51.75% 0.1453 147.65);
--shiki-token-number: #111111;
--shiki-token-property: oklch(53.18% 0.2399 256.9900584162342);
}
.shiki .token.constant { color: var(--shiki-token-constant); }
.shiki .token.string { color: var(--shiki-token-string); }
.shiki .token.comment { color: var(--shiki-token-comment); }
.shiki .token.keyword { color: var(--shiki-token-keyword); }
.shiki .token.parameter { color: var(--shiki-token-parameter); }
.shiki .token.function { color: var(--shiki-token-function); }
.shiki .token.string-expression { color: var(--shiki-token-string-expression); }
.shiki .token.punctuation { color: var(--shiki-token-punctuation); }
.shiki .token.link { color: var(--shiki-token-link); }
.shiki .token.number { color: var(--shiki-token-number); }
.shiki .token.property { color: var(--shiki-token-property); }
CodeHighlighter.jsx
import React, { useEffect, useState } from 'react';
import * as shiki from 'shiki';
const CodeHighlighter = ({ code }) => {
const [highlightedCode, setHighlightedCode] = useState('');
useEffect(() => {
const vercelTheme = shiki.createCssVariablesTheme({
name: 'vercel',
variablePrefix: '--shiki-',
variableDefaults: {},
fontStyle: true
});
const highlightCode = async () => {
const highlighter = await shiki.getHighlighter({ langs: ['jsx'], themes: [vercelTheme] });
const highlighted = highlighter.codeToHtml(code, { lang: 'jsx', theme: 'vercel' });
setHighlightedCode(highlighted);
};
highlightCode();
}, [code]);
return (
<div
className="shiki"
style={{
padding: 'var(--editor-padding)',
color: 'var(--shiki-foreground)'
}}
dangerouslySetInnerHTML={{ __html: highlightedCode }}
/>
);
};
export default CodeHighlighter;
App.jsx
import React from 'react';
import CodeHighlighter from './CodeHighlighter';
const codeSnippet = `import { Button } from "@/components/ui/button";
export const Footer = () => {
return (
<footer className="flex items-center justify-center md:mt-12">
<Button className="w-full max-w-96 size="lg">
Archive and next
</Button>
</footer>
);
};`;
function App() {
return (
<div className="App">
<CodeHighlighter code={codeSnippet} />
</div>
);
}
export default App;
37
The Template is complete!
The only problem is... school starts in 2 days.
So, the release day would be moved to...
JUNE 1ST (SATURDAY)!


















