Skip to content

Commit 89d01a6

Browse files
authored
Fix code block tabs styling (#1067)
* tab style * fix kmp * tweaks
1 parent 6646ec4 commit 89d01a6

File tree

9 files changed

+55
-31
lines changed

9 files changed

+55
-31
lines changed

docs/customers/customer-info.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,8 @@ import contentKmp from "@site/code_blocks/customers/customer-info_kmp_1.kts?raw"
229229
content: content27,
230230
},
231231
{
232-
type: "kotlin",
232+
type: "kmp",
233233
content: contentKmp,
234-
name: "Kotlin Multiplatform",
235234
},
236235
{
237236
type: "java",

docs/customers/user-ids.mdx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ import contentKmpAnon from "@site/code_blocks/customers/user-ids_kmp_anon.kts?ra
4343
content: content3,
4444
},
4545
{
46-
type: "kotlin",
46+
type: "kmp",
4747
content: contentKmpAnon,
48-
name: "Kotlin Multiplatform",
4948
},
5049
{
5150
type: "java",
@@ -120,9 +119,8 @@ import contentKmp from "@site/code_blocks/customers/user-ids_kmp.kts?raw";
120119
content: content11,
121120
},
122121
{
123-
type: "kotlin",
122+
type: "kmp",
124123
content: contentKmp,
125-
name: "Kotlin Multiplatform",
126124
},
127125
{
128126
type: "java",
@@ -185,9 +183,8 @@ import contentKmpLogin from "@site/code_blocks/customers/user-ids_kmp_login.kts?
185183
content: content19,
186184
},
187185
{
188-
type: "kotlin",
186+
type: "kmp",
189187
content: contentKmpLogin,
190-
name: "Kotlin Multiplatform",
191188
},
192189
{
193190
type: "java",

docs/getting-started/displaying-products.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import kmpContent1 from "@site/code_blocks/getting-started/displaying-products_k
3939
},
4040
{ type: "objc", content: objectiveCContent2, name: "Objective-C" },
4141
{ type: "kotlin", content: kotlinContent3 },
42-
{ type: "kotlin", content: kmpContent1, name: "Kotlin Multiplatform" },
42+
{ type: "kmp", content: kmpContent1 },
4343
{ type: "java", content: javaContent4 },
4444
{ type: "flutter", content: flutterContent5, name: "Flutter" },
4545
{ type: "rn", content: reactNativeContent6, name: "React Native" },
@@ -123,7 +123,7 @@ import kmpContent2 from "@site/code_blocks/getting-started/displaying-products_k
123123
},
124124
{ type: "objc", content: objectiveCContent11, name: "Objective-C" },
125125
{ type: "kotlin", content: kotlinContent12 },
126-
{ type: "kotlin", content: kmpContent2, name: "Kotlin Multiplatform" },
126+
{ type: "kmp", content: kmpContent2 },
127127
{ type: "java", content: javaContent13 },
128128
{ type: "flutter", content: flutterContent14, name: "Flutter" },
129129
{ type: "rn", content: reactNativeContent15, name: "React Native" },
@@ -213,7 +213,7 @@ import kmpContent3 from "@site/code_blocks/getting-started/displaying-products_k
213213
},
214214
{ type: "objc", content: objectiveCContent33, name: "Objective-C" },
215215
{ type: "kotlin", content: kotlinContent34, name: "Kotlin" },
216-
{ type: "kotlin", content: kmpContent3, name: "Kotlin Multiplatform" },
216+
{ type: "kmp", content: kmpContent3 },
217217
{ type: "java", content: javaContent35, name: "Java" },
218218
{ type: "flutter", content: flutterContent36, name: "Flutter" },
219219
{ type: "rn", content: reactNativeContent37, name: "React Native" },
@@ -259,7 +259,7 @@ import kmpContent4 from "@site/code_blocks/getting-started/displaying-products_k
259259
},
260260
{ type: "objc", content: objectiveCContent42, name: "Objective-C" },
261261
{ type: "kotlin", content: kotlinContent43, name: "Kotlin" },
262-
{ type: "kotlin", content: kmpContent4, name: "Kotlin Multiplatform" },
262+
{ type: "kmp", content: kmpContent4 },
263263
{ type: "java", content: javaContent44, name: "Java" },
264264
{ type: "flutter", content: flutterContent45, name: "Flutter" },
265265
{ type: "rn", content: reactNativeContent46, name: "React Native" },

docs/getting-started/making-purchases.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import kmpContent from "@site/code_blocks/getting-started/making-purchases_kmp_1
2424
{ type: "swift", content: swiftContent1 },
2525
{ type: "objc", content: objectiveCContent2 },
2626
{ type: "kotlin", content: kotlinContent3 },
27-
{ type: "kotlin", content: kmpContent, name: "Kotlin Multiplatform" },
27+
{ type: "kmp", content: kmpContent },
2828
{ type: "java", content: javaContent4 },
2929
{ type: "flutter", content: flutterContent5 },
3030
{ type: "rn", content: reactNativeContent6 },

docs/getting-started/quickstart.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ import kmpContent1 from "@site/code_blocks/getting-started/configuring-sdk_10_km
101101
{ type: "swift", content: swiftContent },
102102
{ type: "objc", content: objectiveCContent },
103103
{ type: "kotlin", content: kotlinContent },
104-
{ type: "kotlin", content: kmpContent1, name: "Kotlin Multiplatform" },
104+
{ type: "kmp", content: kmpContent1 },
105105
{ type: "java", content: javaContent },
106106
{ type: "flutter", content: flutterContent },
107107
{ type: "rn", content: reactNativeContent },
@@ -179,7 +179,7 @@ import webContent36 from "@site/code_blocks/getting-started/getting-started_35.c
179179
{ type: "swift", content: swiftContent27 },
180180
{ type: "objc", content: objectiveCContent28 },
181181
{ type: "kotlin", content: kotlinContent29 },
182-
{ type: "kotlin", content: kotlinContent52, name: "Kotlin Multiplatform" },
182+
{ type: "kmp", content: kotlinContent52 },
183183
{ type: "java", content: javaContent30 },
184184
{ type: "flutter", content: flutterContent31 },
185185
{ type: "rn", content: reactNativeContent32 },
@@ -224,7 +224,7 @@ import kmpContent6 from "@site/code_blocks/customers/customer-info_kmp_1.kts?raw
224224
{ type: "swift", content: swiftContent44 },
225225
{ type: "objc", content: objectiveCContent45 },
226226
{ type: "kotlin", content: kotlinContent46 },
227-
{ type: "kotlin", content: kmpContent6, name: "Kotlin Multiplatform" },
227+
{ type: "kmp", content: kmpContent6 },
228228
{ type: "java", content: javaContent47 },
229229
{ type: "flutter", content: flutterContent48 },
230230
{ type: "rn", content: reactNativeContent49 },
@@ -256,7 +256,7 @@ import kmpContent5 from "@site/code_blocks/getting-started/restoring-purchases_k
256256
{ type: "swift", content: swiftContent36 },
257257
{ type: "objc", content: objectiveCContent37 },
258258
{ type: "kotlin", content: kotlinContent38 },
259-
{ type: "kotlin", content: kmpContent5, name: "Kotlin Multiplatform" },
259+
{ type: "kmp", content: kmpContent5 },
260260
{ type: "java", content: javaContent39 },
261261
{ type: "flutter", content: flutterContent40 },
262262
{ type: "rn", content: reactNativeContent41 },

docs/getting-started/restoring-purchases.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import kmpContent from "@site/code_blocks/getting-started/restoring-purchases_km
2525
{ type: "swift", content: swiftContent },
2626
{ type: "objectivec", content: objectiveCContent, name: "Objective-C" },
2727
{ type: "kotlin", content: kotlinContent },
28-
{ type: "kotlin", content: kmpContent, name: "Kotlin Multiplatform" },
28+
{ type: "kmp", content: kmpContent },
2929
{ type: "java", content: javaContent },
3030
{ type: "flutter", content: flutterContent, name: "Flutter" },
3131
{ type: "rn", content: reactNativeContent, name: "React Native" },

docs/guides/testing-guide/use-cases.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,8 @@ Purchases.sharedInstance.purchaseWith(
294294
content: content3,
295295
},
296296
{
297-
type: "kotlin",
297+
type: "kmp",
298298
content: contentKmpAnon,
299-
name: "Kotlin Multiplatform",
300299
},
301300
{
302301
type: "java",
@@ -364,9 +363,8 @@ Purchases.sharedInstance.purchaseWith(
364363
content: content11,
365364
},
366365
{
367-
type: "kotlin",
366+
type: "kmp",
368367
content: contentKmp,
369-
name: "Kotlin Multiplatform",
370368
},
371369
{
372370
type: "java",

src/components/RCCodeBlock/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ enum Languages {
2020
svelte = "svelte",
2121
brightscript = "brightscript",
2222
json = "json",
23+
kmp = "kmp",
2324
}
2425

2526
// Define types for tab items
@@ -93,6 +94,8 @@ function getTabTitle(type: Languages): string {
9394
return "Java";
9495
case Languages.kotlin:
9596
return "Kotlin";
97+
case Languages.kmp:
98+
return "Kotlin MP";
9699
case Languages.javascript:
97100
return "JavaScript";
98101
case Languages.reactNative:
@@ -124,6 +127,8 @@ function getLanguageType(type: Languages): string {
124127
return "java";
125128
case Languages.kotlin:
126129
return "kotlin";
130+
case Languages.kmp:
131+
return "kotlin";
127132
case Languages.javascript:
128133
return "jsx";
129134
case Languages.reactNative:

src/css/custom.css

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
/* --ifm-menu-color-background-active: rgb(68, 73, 195); */
3535
--ifm-menu-color-active: rgb(255, 255, 255);
3636

37-
--ifm-tabs-padding-vertical: 4px;
38-
--ifm-tabs-padding-horizontal: 6px;
37+
--ifm-tabs-padding-vertical: 0px;
38+
--ifm-tabs-padding-horizontal: 8px;
3939
--ifm-menu-breadcrumb-link: rgb(0, 0, 0);
4040

4141
--ifm-menu-toc-link: rgb(0, 0, 0);
@@ -321,11 +321,6 @@ html[data-theme="dark"]
321321
background-color: #ffffff20;
322322
}
323323

324-
.tabs__item {
325-
font-size: 14px;
326-
font-weight: 600;
327-
}
328-
329324
.breadcrumbs .breadcrumbs__item:nth-of-type(2) {
330325
display: none;
331326
}
@@ -341,8 +336,38 @@ html[data-theme="dark"]
341336
}
342337

343338
.tabs .tabs__item {
344-
letter-spacing: -0.5px;
345-
font-size: 14px;
339+
letter-spacing: -0.25px;
340+
font-size: 13px;
341+
font-weight: 500;
342+
margin-right: 0.25rem;
343+
margin-top: 0.5rem !important;
344+
padding-top: 2px;
345+
padding-bottom: 0px;
346+
}
347+
348+
.tabs .tabs__item--active {
349+
background-color: var(--rc-blue-primary);
350+
color: white;
351+
border-radius: 8px;
352+
border-bottom-width: 0px !important;
353+
}
354+
355+
.tabs-container {
356+
border: 1px solid #e0e0e0;
357+
overflow: hidden;
358+
border-radius: 8px;
359+
padding: 2px;
360+
margin-bottom: 16px;
361+
}
362+
363+
.tabs-container .tabs {
364+
margin-left: 0.5rem;
365+
margin-right: 0.5rem;
366+
flex-wrap: wrap;
367+
}
368+
369+
.tabs-container .margin-top--md {
370+
margin-top: 0.5rem !important;
346371
}
347372

348373
/* Mobile TOC */

0 commit comments

Comments
 (0)