Skip to content

Commit 44d2845

Browse files
carlagnjlecordier
authored andcommitted
feat: DC-4959 Tabs ui revision (prisma#7089)
* Update UI for tabs * Update tabbedcontent * Update all tabbedcontent references * Update seeding * Update seeding spacings * Add hover * Update border thickness of tab items * Update margin-bottom for codewithresult * Update fullwidth as the default * Update squarewrapper * Update max-width and flex alignment
1 parent 5216fc9 commit 44d2845

File tree

13 files changed

+111
-90
lines changed

13 files changed

+111
-90
lines changed

content/200-orm/200-prisma-client/100-queries/062-computed-fields.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Computed fields allow you to derive a new field based on existing data. A common
1010

1111
The following example illustrates how to create a [Prisma Client extension](/orm/prisma-client/client-extensions) that adds a `fullName` computed field at runtime to the `User` model in a Prisma schema.
1212

13-
<TabbedContent transparent code>
13+
<TabbedContent code>
1414

1515
<TabItem value="Prisma Client extension">
1616

content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ To pass arguments to your TypedSQL queries, you can use parameterized queries. T
8484

8585
1. In your SQL file, use placeholders for the parameters you want to pass. The syntax for placeholders depends on your database engine:
8686

87-
<TabbedContent transparent fullWidth>
87+
<TabbedContent transparent>
8888
<TabItem value="PostgreSQL">
8989
For PostgreSQL, use the positional placeholders `$1`, `$2`, etc.:
9090

content/200-orm/200-prisma-client/600-observability-and-logging/130-logging.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ To use event-based logging:
7171

7272
The following example subscribes to all `query` events and write the `duration` and `query` to console:
7373

74-
<TabbedContent transparent code customStyles={{ transform: `translateY(-2rem)` }}>
74+
<TabbedContent code>
7575

7676
<TabItem value="Relational databases">
7777

content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ This guide describes how to seed your database using Prisma Client and Prisma OR
1818

1919
Prisma ORM's integrated seeding functionality expects a command in the `"seed"` key in the `"prisma"` key of your `package.json` file. This can be any command, `prisma db seed` will just execute it. In this guide and as a default, we recommend writing a seed script inside your project's `prisma/` folder and starting it with the command.
2020

21-
<TabbedContent transparent code>
21+
<TabbedContent>
2222
<TabItem value="TypeScript">
23-
<br/>
24-
2523
```json
2624
"prisma": {
2725
"seed": "ts-node prisma/seed.ts"
@@ -43,14 +41,11 @@ This can be useful to reduce memory usage (RAM) and increase execution speed of
4341
</TabItem>
4442

4543
<TabItem value="JavaScript">
46-
<br/>
47-
4844
```json
4945
"prisma": {
5046
"seed": "node prisma/seed.js"
5147
},
5248
```
53-
5449
</TabItem>
5550

5651
</TabbedContent>
@@ -77,7 +72,7 @@ Here we suggest some specific seed scripts for different situations. You are fre
7772

7873
### Seeding your database with TypeScript or JavaScript
7974

80-
<TabbedContent transparent code>
75+
<TabbedContent>
8176

8277
<TabItem value="TypeScript">
8378

@@ -346,7 +341,7 @@ main()
346341

347342
In addition to TypeScript and JavaScript, you can also use a Bash script (`seed.sh`) to seed your database in another language such as Go, or plain SQL.
348343

349-
<TabbedContent transparent code>
344+
<TabbedContent>
350345

351346
<TabItem value="Go">
352347
<br/>

content/200-orm/500-reference/050-prisma-client-reference.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5328,7 +5328,7 @@ const getUsers = await prisma.user.findMany({
53285328

53295329
The following query returns all users where the `sanctuaries` array contains the value `"RSPCA"`:
53305330

5331-
<TabbedContent fullWidth>
5331+
<TabbedContent>
53325332
<TabItem value="PostgreSQL">
53335333

53345334
```ts

src/css/custom.css

Lines changed: 4 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,73 +1028,6 @@ hr {
10281028
}
10291029

10301030
/* TABS */
1031-
.tabs-container {
1032-
width: fit-content;
1033-
margin: 1rem 0;
1034-
max-width: 100%;
1035-
}
1036-
1037-
.tabs-container > div {
1038-
padding: 32px;
1039-
margin-top: 0 !important;
1040-
background-color: var(--main-bgd-color);
1041-
border: 1px solid var(--ifm-tabs-bg-color-active);
1042-
border-radius: 0px 8px 8px;
1043-
font-family: Inter;
1044-
font-size: 14px;
1045-
font-weight: 400;
1046-
line-height: 20px;
1047-
letter-spacing: 0em;
1048-
text-align: left;
1049-
}
1050-
1051-
.tabs-container:has(.code-children) {
1052-
width: auto;
1053-
}
1054-
1055-
.tabs-container > div:has(.code-children) {
1056-
padding: 0;
1057-
}
1058-
1059-
:root[data-theme="light"] .tabs-container > div {
1060-
border-color: #e2e8f0;
1061-
}
1062-
1063-
.tabs-container p {
1064-
margin: 0;
1065-
}
1066-
1067-
.tabs__item {
1068-
padding: 6px 12px;
1069-
margin-right: 4px;
1070-
font-weight: 600;
1071-
font-size: 0.875rem;
1072-
align-items: center;
1073-
border-radius: 4px 4px 0px 0px !important;
1074-
background-color: var(--ifm-tabs-bg-color);
1075-
border: none !important;
1076-
/* color: rgb(113, 128, 150); */
1077-
cursor: pointer;
1078-
-webkit-box-align: center;
1079-
align-items: center;
1080-
display: flex;
1081-
--ifm-tabs-color-active: #fff;
1082-
}
1083-
1084-
.tabs__item:hover {
1085-
background: var(--ifm-tabs-bg-color-active);
1086-
color: var(--ifm-tabs-color-active);
1087-
}
1088-
1089-
.tabs__item--active {
1090-
background: var(--ifm-tabs-bg-color-active);
1091-
color: var(--ifm-tabs-color-active);
1092-
}
1093-
1094-
.tabs__item--active:hover {
1095-
background: var(--ifm-tabs-bg-color-active);
1096-
color: var(--ifm-tabs-color-active);
1097-
}
10981031

10991032
.theme-doc-toc-mobile .table-of-contents {
11001033
padding: 0 0.8rem 0.8rem;
@@ -1553,6 +1486,10 @@ article h6 {
15531486
left: var(--ifm-pre-padding);
15541487
}
15551488

1489+
.language-terminal code > .token-line {
1490+
padding: 0 0 0 calc(var(--ifm-pre-padding) * 2) !important
1491+
}
1492+
15561493
code {
15571494
font-variant: no-common-ligatures no-discretionary-ligatures no-historical-ligatures no-contextual;
15581495
vertical-align: baseline;

src/css/gettingStarted.module.scss

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,15 @@
140140
padding: 22px;
141141
display: inline-block;
142142
border: 1px solid var(--border-color);
143-
background: var(--header-bg-color);
143+
background: var(--surface-primary);
144144
border-radius: 8px;
145145
transition: all 300ms ease-out;
146146
cursor: pointer;
147147

148148
border-color: var(--ifm-btn-border-color);
149-
background: transparent;
150149
color: var(--main-font-color);
151150
&:hover {
152151
border-color: var(--ifm-btn-border-color-active);
153-
background: transparent;
154152
}
155153
&:active,
156154
&:focus {
@@ -169,7 +167,7 @@
169167
display: grid;
170168
gap: 16px;
171169
margin-top: 16px;
172-
justify-content: space-between;
170+
max-width: fit-content;
173171
grid-template-columns: repeat(2, auto);
174172
&:not(.framedList) {
175173
@media (min-width: 1400px) {
@@ -210,7 +208,7 @@
210208
grid-template-columns: repeat(3, auto);
211209
}
212210
.squareWrapper {
213-
background: var(--header-bg-color);
211+
background: var(--surface-primary);
214212
}
215213
}
216214
&.splitList {

src/css/theming.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ html[data-theme="dark"] {
502502
--navbar-items-bg: #090a15cc;
503503
--surface-secondary: #e2e8f0;
504504
--ifm-code-background: #1a202c;
505-
--surface-primary: #090a15;
506505
--surface-brand-grey: #161d2b;
507506
--surface-brand-grey-strong: #2d3748;
508507
--surface-brand-light: #0d3a38;

src/theme/CodeBlock/Line/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ the background in custom CSS file due bug https://github.com/facebook/docusaurus
8181
}
8282

8383
.noLineNumbers {
84-
padding: 0 0 0 calc(var(--ifm-pre-padding));
84+
padding: 0 0 0 calc(var(--ifm-pre-padding)) !important;
8585
margin: 0;
8686
}
8787

src/theme/TabItem/styles.module.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@
1414
.codeChildren {
1515
width: max-content;
1616
max-width: 100%;
17+
> div {
18+
box-shadow: none;
19+
margin-bottom: 0;
20+
}
21+
> div, cmd > div {
22+
background: transparent !important;
23+
> div {
24+
margin: 0;
25+
}
26+
}
27+
cmdresult > div > div {
28+
margin: 0;
29+
}
1730
}
1831

1932
.terminal {

0 commit comments

Comments
 (0)