Skip to content

Commit

Permalink
Merge 925d4ea into a449650
Browse files Browse the repository at this point in the history
  • Loading branch information
cocopon committed Feb 23, 2023
2 parents a449650 + 925d4ea commit 5882b05
Show file tree
Hide file tree
Showing 14 changed files with 844 additions and 368 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/monitor-binding/plugin-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ describe(createMonitorBindingController.name, () => {

assert.strictEqual(bc?.viewProps.get('disabled'), false);
assert.strictEqual(bc?.viewProps.get('hidden'), false);
assert.strictEqual(bc.props.get('label'), 'foo');
bc.viewProps.set('disposed', true);
});

Expand All @@ -85,12 +86,14 @@ describe(createMonitorBindingController.name, () => {
params: {
disabled: true,
hidden: true,
label: 'bar',
},
target: new BindingTarget({foo: 'bar'}, 'foo'),
});

assert.strictEqual(bc?.viewProps.get('disabled'), true);
assert.strictEqual(bc?.viewProps.get('hidden'), true);
assert.strictEqual(bc?.props.get('label'), 'bar');
bc.viewProps.set('disposed', true);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/monitor-binding/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export function createMonitorBindingController<T, P extends BaseMonitorParams>(
return new BindingController(args.document, {
blade: createBlade(),
props: ValueMap.fromObject<LabelPropsObject>({
label: params?.label,
label: params?.label ?? args.target.key,
}),
value: value,
valueController: controller,
Expand Down
35 changes: 34 additions & 1 deletion packages/tweakpane/src/doc/sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
--fg-color-secondary: #{hsla(defs.$base-hue, 5%, 60%, 0.8)};

--a-color: #{hsl(defs.$base-hue - 10, 25%, 55%)};
--code-color: #{hsl(170, 25%, 55%)};
--code-color: #{hsl(170, 20%, 55%)};
--guide-color-comps: #{defs.$base-hue, 5%, 80%};
--heading-color: #{hsl(defs.$base-hue, 5%, 70%)};

Expand Down Expand Up @@ -59,13 +59,41 @@ h6 {
letter-spacing: 0.01em;

a {
color: var(--heading-color);
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
table {
border: var(--bg-color-secondary) solid 2px;
border-collapse: separate;
border-radius: 6px;
border-spacing: 0;
width: 100%;
}
th {
background-color: var(--bg-color-secondary);
color: var(--heading-color);
font-weight: normal;
text-align: start;
}
th,
td {
padding: 8px 16px;

&:not(:first-child) {
border-left: var(--bg-color-secondary) solid 2px;
}
}
tr:not(:first-child) {
th,
td {
border-top: var(--bg-color-secondary) solid 2px;
}
}
code {
font-family: defs.$font-family-mono;
}
Expand All @@ -74,6 +102,11 @@ pre {
}
strong {
color: var(---heading-color);
filter: brightness(0.9) saturate(1.2);

@media (prefers-color-scheme: dark) {
filter: brightness(1.2) saturate(1.2);
}
}

:root .tp-dfwv {
Expand Down
9 changes: 7 additions & 2 deletions packages/tweakpane/src/doc/sass/_defs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,22 @@ $z-index-global-nav: 1003;
}
p {
line-height: 1.6;

}
p,
th,
td,
li {
code {
background-color: var(--bg-color-secondary);
border-radius: 2px;
color: var(--code-color);
font-weight: 500;
letter-spacing: -0.02em;
padding-left: 0.25em;
padding-right: 0.25em;
}
}
a {
:not(h1, h2, h3, h4, h5, h6) a {
color: var(--a-color);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/tweakpane/src/doc/sass/components/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}
}
&_media {
margin-bottom: 1em;
margin-top: 1em;
margin-bottom: 1.5em;
margin-top: 1.5em;
}
}
2 changes: 1 addition & 1 deletion packages/tweakpane/src/doc/sass/components/_migration.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

// dat.GUI
.migration {
.datgui {
.dg {
li + li {
margin-top: 0;
Expand Down
Loading

0 comments on commit 5882b05

Please sign in to comment.