Skip to content

Commit 802dfe8

Browse files
committed
Added CSS import support for TSX
1 parent 4be79ab commit 802dfe8

File tree

7 files changed

+16
-6
lines changed

7 files changed

+16
-6
lines changed

build/esbuild.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,8 @@ const buildConfig : esbuild.BuildOptions = {
4545
outbase: './src/client',
4646
entryPoints: [
4747
'./src/client/**/index.html',
48-
'./src/client/index.tsx',
49-
'./src/client/index.css'
48+
'./src/client/index.tsx'
5049
],
51-
supported: {
52-
'import-attributes': true,
53-
'nesting': true
54-
},
5550
plugins: [
5651
esbuildPluginTransformScriptTags(),
5752
esbuildPluginDeno({

src/client/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ body {
1818
.page {
1919
display: grid;
2020
gap: 100px;
21+
justify-content: center;
2122

2223
.title,
2324
.link {
2425
text-align: center;
26+
border-radius: 10px;
27+
padding: 0 15px 5px;
2528
}
2629

2730
.link {
@@ -30,5 +33,6 @@ body {
3033

3134
.logo {
3235
width: 200px;
36+
margin: auto;
3337
}
3438
}

src/client/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { render } from '@solid-js/web';
22
import { HashRouter, Route } from '@solid-js/router'
33
import { Home } from './pages/home/index.tsx';
44
import { NotFound } from './pages/404/index.tsx';
5+
import './index.css'
56

67

78
render(

src/client/pages/404/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.not-found .title {
2+
background-color: #dd4747;
3+
}

src/client/pages/404/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import type {JSXElement} from '@solid-js'
2+
import './index.css'
3+
24

35
export function NotFound() : JSXElement {
46
return (

src/client/pages/home/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.home .title {
2+
background-color: #3a813a;
3+
}

src/client/pages/home/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import type {JSXElement} from '@solid-js'
2+
import './index.css'
3+
24

35
export function Home() : JSXElement {
46
return (

0 commit comments

Comments
 (0)