Skip to content

Commit d0cdeb0

Browse files
committed
update tab block styles
1 parent bb863dd commit d0cdeb0

File tree

3 files changed

+23
-51
lines changed

3 files changed

+23
-51
lines changed

src/routes/getting-started/installation.mdx

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ mkdir src
102102

103103
Create `src/index.jsx`:
104104

105-
```jsx
105+
```jsx tab title="src/index.jsx"
106106
/* @refresh reload */
107107
import { render } from 'solid-js/web';
108108
import App from './App';
@@ -113,72 +113,38 @@ const root = document.getElementById('root');
113113
render(() => <App />, root);
114114
```
115115

116-
Create `src/App.jsx`:
117-
118-
```jsx
116+
```jsx tab title="src/App.jsx"
119117
import { createSignal } from 'solid-js';
120118

121119
function App() {
122120
const [count, setCount] = createSignal(0);
123121

124122
return (
125-
<div class="App">
126-
<header class="App-header">
127-
<h1>Welcome to Solid</h1>
128-
<p>Count: {count()}</p>
129-
<button onClick={() => setCount(count() + 1)}>
130-
Increment
131-
</button>
132-
</header>
123+
<div class="app">
124+
<h1 class="app-header">Welcome to Solid</h1>
133125
</div>
134126
);
135127
}
136128

137129
export default App;
138130
```
139131

140-
Create `src/index.css`:
141-
142-
```css
132+
```css tab title="src/index.css"
143133
body {
144134
margin: 0;
145-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
146-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
147-
sans-serif;
148-
-webkit-font-smoothing: antialiased;
149-
-moz-osx-font-smoothing: grayscale;
135+
background-color: #f0f0f0;
150136
}
151137

152-
.App {
138+
.app {
153139
text-align: center;
154140
}
155141

156-
.App-header {
157-
background-color: #282c34;
158-
padding: 20px;
159-
color: white;
160-
min-height: 100vh;
161-
display: flex;
162-
flex-direction: column;
163-
align-items: center;
164-
justify-content: center;
142+
.app-header {
143+
color: red;
165144
}
145+
```
166146

167-
button {
168-
background-color: #61dafb;
169-
border: none;
170-
color: #282c34;
171-
padding: 10px 20px;
172-
font-size: 16px;
173-
border-radius: 4px;
174-
cursor: pointer;
175-
margin-top: 10px;
176-
}
177147

178-
button:hover {
179-
background-color: #21a6c7;
180-
}
181-
```
182148

183149
## 7. Add Build Scripts
184150

src/styles/expressive-code.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.expressive-code-overrides .expressive-code {
2-
@apply my-4 font-mono;
2+
@apply mb-4 font-mono;
33
}
44

55
.expressive-code-overrides .expressive-code .frame {
@@ -11,7 +11,7 @@
1111
}
1212

1313
html .expressive-code-overrides .expressive-code pre {
14-
@apply rounded-xl border-[1.5px];
14+
@apply border-[1.5px];
1515
}
1616

1717
/* Copy Button */
@@ -70,7 +70,7 @@ html.windows
7070
.expressive-code-overrides
7171
.expressive-code
7272
pre::-webkit-scrollbar {
73-
@apply h-5 w-5 rounded-xl border-[6px] border-solid border-transparent bg-slate-200/80;
73+
@apply h-5 w-5 border-[6px] border-solid border-transparent bg-slate-200/80;
7474
background-clip: content-box;
7575
}
7676
html.windows.dark

src/ui/tabs.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ export type TabListProps = PolymorphicProps<
2323

2424
export function TabList(props: TabListProps) {
2525
return (
26-
<div class="custom-scrollbar mb-2 flex overflow-x-auto">
27-
<KobalteTabs.List {...props} class="flex border-b-2 border-slate-800" />
26+
<div class="custom-scrollbar flex overflow-x-auto overflow-y-hidden">
27+
<KobalteTabs.List
28+
{...props}
29+
class="z-1 flex w-full border-b border-blue-200 dark:border-slate-800"
30+
/>
2831
</div>
2932
);
3033
}
@@ -38,7 +41,7 @@ export function Tab(props: TabProps) {
3841
return (
3942
<KobalteTabs.Trigger
4043
{...props}
41-
class="relative top-0.5 px-5 py-1 transition-colors duration-300 aria-selected:border-b-2 aria-selected:border-blue-400 aria-selected:font-bold aria-selected:text-blue-500 aria-selected:dark:text-slate-300"
44+
class="z-2 aria-selected-before:w-full aria-selected:before:border-blue relative top-0.5 appearance-none bg-none px-[16px] py-[4px] outline-none transition-colors duration-150 aria-selected:h-full aria-selected:bg-slate-200 aria-selected:text-black aria-selected:before:absolute aria-selected:before:inset-0 aria-selected:before:border-t aria-selected:before:border-blue-600 aria-selected:dark:bg-slate-800 aria-selected:dark:text-white aria-selected:before:dark:border-blue-200"
4245
/>
4346
);
4447
}
@@ -50,6 +53,9 @@ export type TabPanelProps = PolymorphicProps<
5053

5154
export function TabPanel(props: TabPanelProps) {
5255
return (
53-
<KobalteTabs.Content {...props} class="hidden data-[selected]:block" />
56+
<KobalteTabs.Content
57+
{...props}
58+
class="hidden rounded-b-md bg-white data-[selected]:block dark:bg-slate-950"
59+
/>
5460
);
5561
}

0 commit comments

Comments
 (0)