Skip to content

Commit 5ae596b

Browse files
committed
more refinements on the tabs
1 parent ac86110 commit 5ae596b

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

components/CodeExample.re

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module Toggle = {
9191
})
9292
| multiple =>
9393
let numberOfItems = Js.Array.length(multiple);
94-
let labels =
94+
let tabElements =
9595
Belt.Array.mapWithIndex(
9696
multiple,
9797
(i, tab) => {
@@ -107,7 +107,7 @@ module Toggle = {
107107
};
108108

109109
let activeClass =
110-
selected === i ? "font-bold text-gray-100 bg-snow-light" : "hover:cursor-pointer border-gray-20 border-r";
110+
selected === i ? "font-bold text-gray-100 bg-snow-light border border-b-0 border-snow-dark border-gray-20" : "border-gray-20 border-b hover:cursor-pointer";
111111

112112
let onClick = evt => {
113113
ReactEvent.Mouse.preventDefault(evt);
@@ -124,7 +124,7 @@ module Toggle = {
124124
<span
125125
key
126126
className={
127-
paddingX ++ " px-4 inline-block p-2 bg-gray-10 rounded-sm " ++ activeClass
127+
paddingX ++ " flex-none px-4 inline-block p-2 bg-gray-10 rounded-tl rounded-tr " ++ activeClass
128128
}
129129
onClick>
130130
label->s
@@ -146,12 +146,17 @@ module Toggle = {
146146
->Belt.Option.getWithDefault(React.null);
147147

148148
<div
149-
className="flex w-full flex-col rounded-none xs:rounded border-t border-b xs:border border-snow-dark bg-snow-light pb-2 text-night-dark">
149+
className="flex w-full flex-col rounded-none text-night-dark">
150150
<div
151-
className="flex overflow-auto scrolling-touch font-sans mb-6 mb-4 text-sm bg-gray-10 text-gray-60-tr">
152-
labels->ate
151+
className="flex w-full overflow-auto scrolling-touch font-sans bg-transparent text-sm text-gray-60-tr">
152+
<div className="flex">
153+
tabElements->ate
154+
</div>
155+
<div className="flex-1 border-b border-gray-20">
156+
{j|\u00A0|j}->s
157+
</div>
153158
</div>
154-
<div className="px-4 text-base pb-2 overflow-x-auto -mt-2">
159+
<div className="px-4 text-base pb-4 pt-4 overflow-x-auto bg-snow-light border-snow-dark xs:rounded-b border border-t-0">
155160
<pre> children </pre>
156161
</div>
157162
</div>;

components/Markdown.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ module CodeTab = {
432432
},
433433
);
434434

435-
<div className="mt-4 mb-10">
435+
<div className="mt-4 mb-10 -mx-6 xs:mx-0">
436436
<CodeExample.Toggle tabs />
437437
</div>
438438
};

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ module.exports = {
283283
cursor: ["hover"],
284284
width: ["responsive"],
285285
border: ["hover", "responsive"],
286-
borderWidth: ["active", "responsive", "last"],
286+
borderWidth: ["active", "responsive", "last", "first"],
287287
padding: ["hover", "responsive", "last"],
288288
margin: ["hover", "responsive", "first", "last"],
289289
visibility: ["group-hover"],

0 commit comments

Comments
 (0)