Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: theming tweaks #1727

Merged
merged 40 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b755aea
add lengend color
dsmmcken Jan 11, 2024
13ca91b
widget list hover color
dsmmcken Jan 11, 2024
68da794
settings menu user image and logo button adjust
dsmmcken Jan 11, 2024
c636fb3
schotcut settings rror message styling
dsmmcken Jan 11, 2024
dbd655d
purge primary-light
dsmmcken Jan 11, 2024
7ece3a0
add some spectrum stuff to styleguide for easier comparison
dsmmcken Jan 11, 2024
0710b7a
styleguide icon button styling
dsmmcken Jan 11, 2024
7a4a50c
expose is modified styling to styleguide timeslider for checking
dsmmcken Jan 11, 2024
7a7ca07
whitespace change
dsmmcken Jan 11, 2024
26044b9
Buttons can use gap instead of margin on icons now that they are flex…
dsmmcken Jan 11, 2024
3fabc51
add fallback colors for a few more things, so that error message befo…
dsmmcken Jan 11, 2024
0eecd8c
item-list sstyling
dsmmcken Jan 11, 2024
f3f1153
fix styling of cutstom time selct
dsmmcken Jan 11, 2024
83b4b6e
fix HCM sstyling
dsmmcken Jan 11, 2024
e29c95b
adjust timeslider styling
dsmmcken Jan 11, 2024
68fe587
fix malformed hsl variable
dsmmcken Jan 11, 2024
8e07b71
Numerous color adjustments
dsmmcken Jan 11, 2024
e0cadc7
fix console button disabled object styling
dsmmcken Jan 11, 2024
9050a42
style editor in conditional formating style fixes
dsmmcken Jan 11, 2024
6b521e5
minor color fixes
dsmmcken Jan 11, 2024
1194513
style tweaks
dsmmcken Jan 11, 2024
8f25633
fix button alignment
dsmmcken Jan 12, 2024
37f470d
added subdued-content-bg variable
dsmmcken Jan 12, 2024
c9f9236
tweaked light theme to be grayer
dsmmcken Jan 12, 2024
4e4db0d
adjusted dark surface color
dsmmcken Jan 12, 2024
88c8ce7
adjust subdued-content-bg defninition
dsmmcken Jan 12, 2024
cc1f8e1
light disabled color for secondary buttons
dsmmcken Jan 12, 2024
c53e908
stylelint fixes
dsmmcken Jan 12, 2024
da567a7
fix failure
dsmmcken Jan 12, 2024
a45fded
redifine a color so it doesn't need to manually overriden by themes
dsmmcken Jan 12, 2024
8eaa4cb
fix filter bar active color light theme
dsmmcken Jan 15, 2024
a87a1b8
fix checkbox/radio alignment in spectrum
dsmmcken Jan 15, 2024
9d0297a
styleguide formatting
dsmmcken Jan 15, 2024
a109b07
difffffffffffffffffffffffffffffffffffffffffffffffffs
dsmmcken Jan 15, 2024
ab35ec5
fix failing test from button change
dsmmcken Jan 15, 2024
982c905
webkit can you not
dsmmcken Jan 15, 2024
7c0b99d
light theme header bar color tweak
dsmmcken Jan 15, 2024
60448f0
final final polish
dsmmcken Jan 16, 2024
54126f7
dunno.
dsmmcken Jan 16, 2024
6262177
fix linting
dsmmcken Jan 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/chart/src/ChartTheme.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
paper-bgcolor: var(--dh-color-chart-bg);
plot-bgcolor: var(--dh-color-chart-plot-bg);
title-color: var(--dh-color-chart-title);
legend-color: var(--dh-color-chart-legend-color);
colorway: var(--dh-color-chart-colorway);
gridcolor: var(--dh-color-chart-grid);
linecolor: var(--dh-color-chart-axis-line);
Expand Down
2 changes: 2 additions & 0 deletions packages/chart/src/ChartTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface ChartTheme {
paper_bgcolor: string;
plot_bgcolor: string;
title_color: string;
legend_color: string;
colorway: string;
gridcolor: string;
linecolor: string;
Expand Down Expand Up @@ -48,6 +49,7 @@ export function defaultChartTheme(): Readonly<ChartTheme> {
paper_bgcolor: chartTheme['paper-bgcolor'],
plot_bgcolor: chartTheme['plot-bgcolor'],
title_color: chartTheme['title-color'],
legend_color: chartTheme['legend-color'],
colorway: chartTheme.colorway,
gridcolor: chartTheme.gridcolor,
linecolor: chartTheme.linecolor,
Expand Down
5 changes: 5 additions & 0 deletions packages/chart/src/ChartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,11 @@ class ChartUtils {
color: theme.title_color,
},
},
legend: {
font: {
color: theme.legend_color,
},
},
};

if (type === dh.plot.AxisType.X) {
Expand Down
1 change: 1 addition & 0 deletions packages/chart/src/__snapshots__/ChartTheme.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports[`defaultChartTheme should create the default chart theme 1`] = `
"error_band_fill_color": "chartTheme['error-band-fill-color']",
"error_band_line_color": "chartTheme['error-band-line-color']",
"gridcolor": "chartTheme['gridcolor']",
"legend_color": "chartTheme['legend-color']",
"line_color": "chartTheme['line-color']",
"linecolor": "chartTheme['linecolor']",
"ohlc_decreasing": "chartTheme['ohlc-decreasing']",
Expand Down
2 changes: 1 addition & 1 deletion packages/code-studio/src/main/WidgetList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

$widget-list-color: $gray-200;
$widget-list-hover-color: $foreground;
$widget-list-background-hover-color: $primary;
$widget-list-background-hover-color: var(--dh-color-highlight-hover);

$widget-list-owner-color: $gray-400;
$widget-list-owner-hover-color: $gray-200;
Expand Down
10 changes: 8 additions & 2 deletions packages/code-studio/src/settings/SettingsMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $settings-menu-header-color: var(--dh-color-fg);

$settings-menu-collapse-trigger-color: var(--dh-color-fg);

$settings-menu-rule-bg: $gray-800;
$settings-menu-rule-bg: var(--dh-color-gray-400);
$settings-menu-rule-button-color: $gray-300;
$settings-menu-rule-border: $gray-400;
$settings-menu-rule-focused-border: $primary;
Expand Down Expand Up @@ -107,8 +107,13 @@ $settings-menu-z-index: $zindex-modal;
height: $settings-menu-header-user-image-size;
width: $settings-menu-header-user-image-size;
margin: $spacer $spacer-2 $spacer $spacer;
background: $gray-400;
background: var(--dh-color-accent-1100);
border-radius: $border-radius;

svg {
color: var(--dh-color-accent-contrast);
}

img {
height: $settings-menu-header-user-image-size;
width: $settings-menu-header-user-image-size;
Expand Down Expand Up @@ -136,6 +141,7 @@ $settings-menu-z-index: $zindex-modal;
text-decoration: underline;
font-size: smaller;
padding: 0 $spacer-1;
height: 28px;

&:focus {
background: hsla(var(--dh-color-fg-hsl), $focus-bg-transparency);
Expand Down
5 changes: 1 addition & 4 deletions packages/code-studio/src/settings/ShortcutItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0 0.5rem;
border-radius: $border-radius;

&.is-invalid {
color: $danger;
background-color: $toast-error-bg;
color: var(--dh-color-form-control-error);
}

.shortcut-item-message {
Expand Down
1 change: 0 additions & 1 deletion packages/code-studio/src/styleguide/Colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function Colors(): React.ReactElement {
'foreground',
'primary',
'primary-dark',
'primary-light',
'secondary',
'secondary-hover',
'success',
Expand Down
23 changes: 20 additions & 3 deletions packages/code-studio/src/styleguide/SpectrumComparison.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import {
ComboBox,
Flex,
Grid,
Icon,
Item,
Picker,
Radio,
RadioGroup,
SpectrumButtonProps,
Text,
TextField,
View,
} from '@adobe/react-spectrum';
Expand All @@ -25,6 +27,8 @@ import {
Select,
} from '@deephaven/components';
import { EMPTY_FUNCTION } from '@deephaven/utils';
import { vsPlay } from '@deephaven/icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
SAMPLE_SECTION_E2E_IGNORE,
SPECTRUM_COMPARISON_SAMPLES_ID,
Expand Down Expand Up @@ -68,18 +72,31 @@ export function SpectrumComparison(): JSX.Element {
<Flex gap={20} wrap>
<View>
<h3>Buttons - Filled</h3>
<Grid gap={20} columns="repeat(2, 120px)" autoRows="40x">
<Grid
gap={20}
columns="repeat(2, 120px)"
autoRows="40x"
justifyItems="start"
alignItems="start"
>
<label>Bootstrap</label>
<label>Spectrum</label>

{buttons.map(([level, variant]) => (
<Fragment key={level}>
<BootstrapButtonOld onClick={EMPTY_FUNCTION} kind={level}>
<BootstrapButtonOld
onClick={EMPTY_FUNCTION}
kind={level}
icon={vsPlay}
>
Button
</BootstrapButtonOld>

<Button variant={variant} style="fill">
Button
<Icon>
<FontAwesomeIcon icon={vsPlay} />
</Icon>
<Text>Button</Text>
</Button>
</Fragment>
))}
Expand Down
13 changes: 13 additions & 0 deletions packages/code-studio/src/styleguide/SpectrumComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
Divider,
ButtonGroup,
Flex,
ListView,
} from '@adobe/react-spectrum';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { dhTruck, vsEmptyWindow } from '@deephaven/icons';
Expand Down Expand Up @@ -236,6 +237,18 @@ function IllustratedMessageSample(): JSX.Element {
function TableViewSample(): JSX.Element {
return (
<>
<label id="table-view-sample">List View</label>
<ListView
selectionMode="multiple"
maxWidth="size-6000"
marginBottom="size-200"
>
<Item>One</Item>
<Item>Two</Item>
<Item>Three</Item>
<Item>Four</Item>
</ListView>

<label id="table-view-sample">Table View</label>
<TableView aria-labelledby="table-view-sample" selectionMode="multiple">
<TableHeader>
Expand Down
5 changes: 5 additions & 0 deletions packages/code-studio/src/styleguide/StyleGuide.scss
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ h5.sub-title {
background-color: transparent;
height: auto;
padding: $spacer-2 2px;

.svg-inline--fa {
align-self: center;
}

&:focus {
border-color: $primary;
}
Expand Down
18 changes: 15 additions & 3 deletions packages/code-studio/src/styleguide/TimeSliderInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { TimeSlider } from '@deephaven/components';
import { sampleSectionIdAndClasses } from './utils';

interface TimeSliderInputsState {
initialStartTime: number;
initialEndTime: number;
startTime: number;
endTime: number;
}
Expand All @@ -18,6 +20,8 @@ class TimeSliderInputs extends PureComponent<

this.handleSliderChange = this.handleSliderChange.bind(this);
this.state = {
initialStartTime: 24 * 60 * 60 * 0.25,
initialEndTime: 24 * 60 * 60 * 0.75,
startTime: 24 * 60 * 60 * 0.25, // example start and end times
endTime: 24 * 60 * 60 * 0.75, // example start and end times
};
Expand All @@ -30,7 +34,9 @@ class TimeSliderInputs extends PureComponent<
}

render(): React.ReactElement {
const { startTime, endTime } = this.state;
const { startTime, endTime, initialStartTime, initialEndTime } = this.state;
const isStartModified = startTime !== initialStartTime;
const isEndModified = endTime !== initialEndTime;
return (
<div
{...sampleSectionIdAndClasses('time-slider-inputs', [
Expand All @@ -41,10 +47,16 @@ class TimeSliderInputs extends PureComponent<
<TimeSlider
startTime={startTime}
endTime={endTime}
isStartModified={isStartModified}
isEndModified={isEndModified}
onChange={this.handleSliderChange}
/>
<p>StartTime: {TimeUtils.formatTime(startTime)}</p>
<p>EndTime: {TimeUtils.formatTime(endTime)}</p>
<p style={isStartModified ? { color: 'var(--dh-color-modified)' } : {}}>
dsmmcken marked this conversation as resolved.
Show resolved Hide resolved
StartTime: {TimeUtils.formatTime(startTime)}
</p>
<p style={isEndModified ? { color: 'var(--dh-color-modified)' } : {}}>
EndTime: {TimeUtils.formatTime(endTime)}
</p>
</div>
);
}
Expand Down
24 changes: 13 additions & 11 deletions packages/components/scss/BaseStyleSheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,13 @@ button:focus {
display: inline-flex;
align-items: center;
justify-content: center;
padding-top: 3px;
padding-bottom: 5px;
// match spectrum button custom padding
padding: 4px 14px 3px 14px;
gap: 6px;

.svg-inline--fa {
padding-bottom: 2px;
}
}

.btn-sm {
Expand Down Expand Up @@ -162,8 +167,8 @@ span.btn-disabled-wrapper {
min-width: unset;
padding: $spacer-1;

svg {
margin-right: $spacer-1;
.svg-inline--fa {
align-self: center;
}

&:not(.btn-link-icon) {
Expand Down Expand Up @@ -214,9 +219,6 @@ span.btn-disabled-wrapper {

.btn-spinner {
padding: $btn-padding-y 1rem;
.fa-layers {
margin-right: 0.5rem;
}
}

.btn-link.no-underline,
Expand All @@ -235,10 +237,6 @@ span.btn-disabled-wrapper {
padding-left: $spacer-1;
padding-right: $spacer-1;

svg {
margin-right: 0;
}

&::after {
content: '';
box-sizing: border-box;
Expand Down Expand Up @@ -339,6 +337,10 @@ span.btn-disabled-wrapper {
color: var(--dh-color-action-fg);
font-weight: $font-weight-normal;

.svg-inline--fa {
align-self: center;
}

&.active {
border-color: var(--dh-color-action-active-border);
background: var(--dh-color-action-active-bg);
Expand Down
16 changes: 9 additions & 7 deletions packages/components/scss/bootstrap_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ $green: var(--dh-color-visual-green);
$blue: var(--dh-color-visual-blue);
$purple: var(--dh-color-visual-purple);

// Fallback colors are used if theme isn't loaded
// this is required for error messages if the API doesn't load

//Define our Gray scale
$gray-100: var(--dh-color-gray-900, #fcfcfa);
$gray-200: var(--dh-color-gray-800);
Expand All @@ -31,8 +34,8 @@ $interfaceblue: var(--dh-color-accent-bg);
$interfacewhite: $white;
$interfaceblack: $black;
$content-bg: var(--dh-color-content-bg, #2d2a2e);
$background: var(--dh-color-bg);
$foreground: var(--dh-color-fg);
$background: var(--dh-color-bg, #1a171a);
$foreground: var(--dh-color-fg, #f0f0ee);

// Extend default Bootstrap $grays map
$grays-custom: (
Expand Down Expand Up @@ -93,7 +96,6 @@ $body-color: $interfacewhite;
$primary: var(--dh-color-accent-bg);
$primary-hover: var(--dh-color-accent-hover-bg);
$primary-dark: var(--dh-color-accent-down-bg);
$primary-light: var(--dh-color-accent-1100);
$secondary: var(--dh-color-neutral-bg);
$secondary-hover: var(--dh-color-neutral-hover-bg);
$success: $green;
Expand All @@ -112,7 +114,6 @@ $mid: var(--dh-color-gray-mid);

$semantic-colors: (
'primary-hover': $primary-hover,
'primary-light': $primary-light,
'primary-dark': $primary-dark,
'mid': $mid,
'content-bg': $interfacegray,
Expand Down Expand Up @@ -180,9 +181,10 @@ $input-btn-focus-color: hsla(var(--dh-color-accent-hsl), 0.35);
$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;
$input-btn-line-height: 1.3;
// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).
// The padding-y value has to be in rem to match units. Using 0.4214rem with 1.3
// line height gets us to 31.99px vs Spectrum's 32px.
$input-btn-padding-y: 0.4214rem;
// The padding-y value has to be in rem to match units as it is a SASS calc.
// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.
/* stylelint-disable-next-line number-max-precision */
$input-btn-padding-y: 0.42145rem;
dsmmcken marked this conversation as resolved.
Show resolved Hide resolved

//checkbox
$custom-control-indicator-bg: var(--dh-color-input-bg);
Expand Down
12 changes: 9 additions & 3 deletions packages/components/src/AutoCompleteInput.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
@import '../scss/custom.scss';

$aci-option-btn-color: $foreground;
$aci-option-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);
$aci-option-hover-bg: $dropdown-link-hover-bg;
$aci-option-hover-color: $dropdown-link-hover-color;
$aci-option-hover-bg: var(--dh-color-item-list-hover-bg);
$aci-option-keyboard-selected-bg: var(--dh-color-item-list-selected-bg);
$aci-option-keyboard-selected-hover-bg: var(
--dh-color-item-list-selected-hover-bg
);
$aci-option-hover-color: $foreground;

.aci-container {
flex-grow: 1;
Expand All @@ -30,6 +33,9 @@ $aci-option-hover-color: $dropdown-link-hover-color;
}
.aci-option-btn.keyboard-active {
background-color: $aci-option-keyboard-selected-bg;
&:hover {
background-color: $aci-option-keyboard-selected-hover-bg;
}
}

.aci-option-btn:hover {
Expand Down
Loading
Loading