Skip to content

Commit 3ef9dd5

Browse files
committed
css improvements
1 parent 7750b60 commit 3ef9dd5

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

src/generators/jsx-ast/utils/buildContent.mjs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,14 @@ const transformStabilityNode = ({ data }, index, parent) => {
104104
const transformHeadingNode = (entry, node, index, parent) => {
105105
const { data, children } = node;
106106
const headerChildren = [
107-
createElement(
108-
`h${data.depth + 1}`,
109-
{
110-
style: 'display: flex; align-items: center; gap: 8px;',
111-
},
112-
[createElement(`a#${data.slug}`, { href: `#${data.slug}` }, children)]
113-
),
107+
createElement(`h${data.depth + 1}`, [
108+
createElement(`a#${data.slug}`, { href: `#${data.slug}` }, children),
109+
]),
114110
];
115111

116112
// Add type icon if available
117113
if (data.type && data.type !== 'misc') {
114+
headerChildren[0].properties.className = 'has-datatag';
118115
headerChildren[0].children.unshift(
119116
createJSXElement(JSX_IMPORTS.DataTag.name, {
120117
kind: data.type,

src/generators/web/client/hooks/useTheme.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useState, useEffect } from 'react';
44
* This hook provides theme management functionality
55
*/
66
export const useTheme = () => {
7-
/** @type {['light' | 'dark', Function]} */
87
const [theme, setTheme] = useState('light');
98

109
useEffect(() => {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@import '@node-core/ui-components/styles/index.css';
2+
3+
.has-datatag {
4+
display: flex;
5+
align-items: center;
6+
gap: 8px;
7+
}

src/generators/web/utils/astBuilder.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export default () => {
5050
...baseImports,
5151
createImportDeclaration(
5252
null,
53-
'@node-core/ui-components/styles/index.css'
53+
// Relative to ESBUILD_RESOLVE_DIR
54+
'./index.css'
5455
),
5556
createImportDeclaration('hydrate', 'preact', false),
5657

0 commit comments

Comments
 (0)