Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
add variables to dropdownVariables
Browse files Browse the repository at this point in the history
  • Loading branch information
silviuaavram committed Feb 25, 2020
1 parent 6cec78e commit 0f10ca2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export type DropdownItemStylesProps = Pick<
hasHeader?: boolean
}

const dropdownItemStyles: ComponentSlotStylesPrepared<DropdownItemProps, DropdownVariables> = {
const dropdownItemStyles: ComponentSlotStylesPrepared<
DropdownItemStylesProps,
DropdownVariables
> = {
root: ({ props: p, variables: v, theme: { siteVariables } }): ICSSInJSStyle => ({
display: 'flex',
alignItems: 'center',
Expand Down Expand Up @@ -50,7 +53,7 @@ const dropdownItemStyles: ComponentSlotStylesPrepared<DropdownItemProps, Dropdow
}),
header: ({ props: p, variables: v }): ICSSInJSStyle => ({
flexGrow: 1,
lineHeight: v.headerLineHeight,
lineHeight: v.listItemHeaderLineHeight,

fontSize: v.listItemHeaderFontSize,
// if the item doesn't have content - i.e. it is header only - then it should use the content color
Expand All @@ -67,7 +70,7 @@ const dropdownItemStyles: ComponentSlotStylesPrepared<DropdownItemProps, Dropdow
}),
content: ({ variables: v }): ICSSInJSStyle => ({
flexGrow: 1,
lineHeight: v.contentLineHeight,
lineHeight: v.listItemContentLineHeight,
fontSize: v.listItemContentFontSize,
color: v.listItemContentColor,
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
import dropdownVariables from './dropdownVariables'

export interface DropdownItemVariables {
headerLineHeight: string
contentLineHeight: string
}

export default (siteVariables): DropdownItemVariables => ({
// Header
// TODO: prod app uses 17.5px here, it should be 16px per the design guide!
headerLineHeight: siteVariables.lineHeightSmall,
contentLineHeight: siteVariables.lineHeightSmall,
...dropdownVariables,
})
export default dropdownVariables
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export interface DropdownVariables {
listItemColorActive: string
listItemSelectedFontWeight: number
listItemSelectedColor: string
listItemHeaderLineHeight: string
listItemContentLineHeight: string
selectedItemColor: string
selectedItemBackgroundColor: string
selectedItemColorFocus: string
Expand Down Expand Up @@ -76,6 +78,9 @@ export default (siteVars): DropdownVariables => ({
listItemColorActive: siteVars.colors.grey[750],
listItemSelectedFontWeight: siteVars.fontWeightSemibold,
listItemSelectedColor: siteVars.colors.grey[750],
// TODO: prod app uses 17.5px here, it should be 16px per the design guide!
listItemHeaderLineHeight: siteVars.lineHeightSmall,
listItemContentLineHeight: siteVars.lineHeightSmall,
selectedItemBackgroundColor: 'undefined',
selectedItemColorFocus: siteVars.bodyColor,
selectedItemBackgroundColorFocus: siteVars.colors.brand[200],
Expand Down

0 comments on commit 0f10ca2

Please sign in to comment.