Skip to content

Commit

Permalink
chore: center the falafel icon, move style constants to more general …
Browse files Browse the repository at this point in the history
…location #2127
  • Loading branch information
marek-mihok committed Oct 6, 2023
1 parent 443748b commit 825fa81
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ui/src/card_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const
$nest: {
'>div:first-child': {
padding: 12,
paddingTop: 10,
fontSize: 16,
color: cssVar('$text7')
},
Expand All @@ -38,6 +39,7 @@ const
icon: {
userSelect: 'none',
color: cssVar('$text'),
marginRight: -4,
$nest: {
'&:hover': {
color: cssVar('$themePrimary'),
Expand Down
3 changes: 3 additions & 0 deletions ui/src/parts/styleConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ export const Z_INDEX = {
TIME_PICKER: 4,
NOTIFICATION_BAR: 5
}

export const CARD_TITLE_PADDING_TOP = 16
export const CARD_TITLE_HEIGHT = 17
5 changes: 2 additions & 3 deletions ui/src/plot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { cards, grid } from './layout'
import { cssVarValue, cssVar, formItemWidth, themeB, themesB } from './theme'
import { bond, wave } from './ui'
import { Command } from './toolbar'
import { CARD_TITLE_HEIGHT, CARD_TITLE_PADDING_TOP } from './parts/styleConstants'

let
cat10 = [
Expand All @@ -38,8 +39,6 @@ let
'$brown',
]

export const TITLE_PADDING_TOP = 16
export const TITLE_HEIGHT = 17


type AnnotationOption = ArcOption | LineOption | TextOption | RegionOption | DataMarkerOption | DataRegionOption
Expand Down Expand Up @@ -1201,7 +1200,7 @@ export const View = bond(({ name, state, changed }: Model<State & { commands?: C
{title && <div className='wave-s12 wave-w6'>{title}</div>}
<div
className={css.body}
style={{ paddingTop: title ? TITLE_PADDING_TOP : commands?.length ? TITLE_PADDING_TOP + TITLE_HEIGHT : 0 }}
style={{ paddingTop: title ? CARD_TITLE_PADDING_TOP : commands?.length ? CARD_TITLE_PADDING_TOP + CARD_TITLE_HEIGHT : 0 }}
>
<XVisualization model={{ name, plot, data, events, interactions, animate }} />
</div>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/vega.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { Result } from 'vega-embed'
import { cards } from './layout'
import { formItemWidth } from './theme'
import { bond, debounce } from './ui'
import { TITLE_HEIGHT, TITLE_PADDING_TOP } from './plot'
import { Command } from './toolbar'
import { CARD_TITLE_HEIGHT, CARD_TITLE_PADDING_TOP } from './parts/styleConstants'

const
css = stylesheet({
Expand Down Expand Up @@ -151,7 +151,7 @@ export const
{title && <div className='wave-s12 wave-w6'>{title}</div>}
<div
className={css.body}
style={{ paddingTop: title ? TITLE_PADDING_TOP : commands?.length ? TITLE_PADDING_TOP + TITLE_HEIGHT : 0 }}
style={{ paddingTop: title ? CARD_TITLE_PADDING_TOP : commands?.length ? CARD_TITLE_PADDING_TOP + CARD_TITLE_HEIGHT : 0 }}
>
<XVegaVisualization model={{ specification, data, grammar }} />
</div>
Expand Down

0 comments on commit 825fa81

Please sign in to comment.