Skip to content
Merged
Changes from all commits
Commits
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
14 changes: 11 additions & 3 deletions packages/ui-table/src/Table/ColHeader/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

import type { Theme } from '@instructure/ui-themes'
import type { Theme, ThemeSpecificStyle } from '@instructure/ui-themes'
import { TableColHeaderTheme } from '@instructure/shared-types'

/**
Expand All @@ -31,7 +31,14 @@ import { TableColHeaderTheme } from '@instructure/shared-types'
* @return {Object} The final theme object with the overrides and component variables
*/
const generateComponentTheme = (theme: Theme): TableColHeaderTheme => {
const { typography, colors, borders, spacing } = theme
const { typography, colors, borders, spacing, key: themeName } = theme

const themeSpecificStyle: ThemeSpecificStyle<TableColHeaderTheme> = {
canvas: {
focusOutlineColor: theme['ic-brand-primary'],
sortedIconColor: theme['ic-brand-primary']
}
}

const componentVariables: TableColHeaderTheme = {
fontSize: typography?.fontSizeMedium,
Expand All @@ -54,7 +61,8 @@ const generateComponentTheme = (theme: Theme): TableColHeaderTheme => {
}

return {
...componentVariables
...componentVariables,
...themeSpecificStyle[themeName]
}
}

Expand Down
Loading