@sussudio/platform
Version:
Internal APIs for VS Code's service injection the base services.
166 lines (165 loc) • 7.5 kB
JavaScript
import {
keybindingLabelBackground,
keybindingLabelBorder,
keybindingLabelBottomBorder,
keybindingLabelForeground,
asCssValue,
widgetShadow,
buttonForeground,
buttonSeparator,
buttonBackground,
buttonHoverBackground,
buttonSecondaryForeground,
buttonSecondaryBackground,
buttonSecondaryHoverBackground,
buttonBorder,
progressBarBackground,
inputActiveOptionBorder,
inputActiveOptionForeground,
inputActiveOptionBackground,
editorWidgetBackground,
editorWidgetForeground,
contrastBorder,
checkboxBorder,
checkboxBackground,
checkboxForeground,
problemsErrorIconForeground,
problemsWarningIconForeground,
problemsInfoIconForeground,
inputBackground,
inputForeground,
inputBorder,
textLinkForeground,
inputValidationInfoBorder,
inputValidationInfoBackground,
inputValidationInfoForeground,
inputValidationWarningBorder,
inputValidationWarningBackground,
inputValidationWarningForeground,
inputValidationErrorBorder,
inputValidationErrorBackground,
inputValidationErrorForeground,
listFilterWidgetBackground,
listFilterWidgetNoMatchesOutline,
listFilterWidgetOutline,
listFilterWidgetShadow,
badgeBackground,
badgeForeground,
breadcrumbsBackground,
breadcrumbsForeground,
breadcrumbsFocusForeground,
breadcrumbsActiveSelectionForeground,
} from '../common/colorRegistry.mjs';
export const defaultKeybindingLabelStyles = getKeybindingLabelStyles({});
export function getKeybindingLabelStyles(override) {
return {
keybindingLabelBackground: asCssValue(override.keybindingLabelBackground ?? keybindingLabelBackground),
keybindingLabelForeground: asCssValue(override.keybindingLabelForeground ?? keybindingLabelForeground),
keybindingLabelBorder: asCssValue(override.keybindingLabelBorder ?? keybindingLabelBorder),
keybindingLabelBottomBorder: asCssValue(override.keybindingLabelBottomBorder ?? keybindingLabelBottomBorder),
keybindingLabelShadow: asCssValue(override.keybindingLabelShadow ?? widgetShadow),
};
}
export const defaultButtonStyles = getButtonStyles({});
export function getButtonStyles(override) {
return {
buttonForeground: asCssValue(override.buttonForeground ?? buttonForeground),
buttonSeparator: asCssValue(override.buttonSeparator ?? buttonSeparator),
buttonBackground: asCssValue(override.buttonBackground ?? buttonBackground),
buttonHoverBackground: asCssValue(override.buttonHoverBackground ?? buttonHoverBackground),
buttonSecondaryForeground: asCssValue(override.buttonSecondaryForeground ?? buttonSecondaryForeground),
buttonSecondaryBackground: asCssValue(override.buttonSecondaryBackground ?? buttonSecondaryBackground),
buttonSecondaryHoverBackground: asCssValue(
override.buttonSecondaryHoverBackground ?? buttonSecondaryHoverBackground,
),
buttonBorder: asCssValue(override.buttonBorder ?? buttonBorder),
};
}
export const defaultProgressBarStyles = getProgressBarStyles({});
export function getProgressBarStyles(override) {
return {
progressBarBackground: asCssValue(override.progressBarBackground ?? progressBarBackground),
};
}
export const defaultToggleStyles = getToggleStyles({});
export function getToggleStyles(override) {
return {
inputActiveOptionBorder: asCssValue(override.inputActiveOptionBorder ?? inputActiveOptionBorder),
inputActiveOptionForeground: asCssValue(override.inputActiveOptionForeground ?? inputActiveOptionForeground),
inputActiveOptionBackground: asCssValue(override.inputActiveOptionBackground ?? inputActiveOptionBackground),
};
}
export const defaultCheckboxStyles = getCheckboxStyles({});
export function getCheckboxStyles(override) {
return {
checkboxBackground: asCssValue(override.checkboxBackground ?? checkboxBackground),
checkboxBorder: asCssValue(override.checkboxBorder ?? checkboxBorder),
checkboxForeground: asCssValue(override.checkboxForeground ?? checkboxForeground),
};
}
export const defaultDialogStyles = getDialogStyle({});
export function getDialogStyle(override) {
return {
dialogBackground: asCssValue(override.dialogBackground ?? editorWidgetBackground),
dialogForeground: asCssValue(override.dialogForeground ?? editorWidgetForeground),
dialogShadow: asCssValue(override.dialogShadow ?? widgetShadow),
dialogBorder: asCssValue(override.dialogBorder ?? contrastBorder),
errorIconForeground: asCssValue(override.errorIconForeground ?? problemsErrorIconForeground),
warningIconForeground: asCssValue(override.warningIconForeground ?? problemsWarningIconForeground),
infoIconForeground: asCssValue(override.infoIconForeground ?? problemsInfoIconForeground),
textLinkForeground: asCssValue(override.textLinkForeground ?? textLinkForeground),
};
}
export const defaultInputBoxStyles = getInputBoxStyle({});
export function getInputBoxStyle(override) {
return {
inputBackground: asCssValue(override.inputBackground ?? inputBackground),
inputForeground: asCssValue(override.inputForeground ?? inputForeground),
inputBorder: asCssValue(override.inputBorder ?? inputBorder),
inputValidationInfoBorder: asCssValue(override.inputValidationInfoBorder ?? inputValidationInfoBorder),
inputValidationInfoBackground: asCssValue(override.inputValidationInfoBackground ?? inputValidationInfoBackground),
inputValidationInfoForeground: asCssValue(override.inputValidationInfoForeground ?? inputValidationInfoForeground),
inputValidationWarningBorder: asCssValue(override.inputValidationWarningBorder ?? inputValidationWarningBorder),
inputValidationWarningBackground: asCssValue(
override.inputValidationWarningBackground ?? inputValidationWarningBackground,
),
inputValidationWarningForeground: asCssValue(
override.inputValidationWarningForeground ?? inputValidationWarningForeground,
),
inputValidationErrorBorder: asCssValue(override.inputValidationErrorBorder ?? inputValidationErrorBorder),
inputValidationErrorBackground: asCssValue(
override.inputValidationErrorBackground ?? inputValidationErrorBackground,
),
inputValidationErrorForeground: asCssValue(
override.inputValidationErrorForeground ?? inputValidationErrorForeground,
),
};
}
export const defaultFindWidgetStyles = {
listFilterWidgetBackground: asCssValue(listFilterWidgetBackground),
listFilterWidgetOutline: asCssValue(listFilterWidgetOutline),
listFilterWidgetNoMatchesOutline: asCssValue(listFilterWidgetNoMatchesOutline),
listFilterWidgetShadow: asCssValue(listFilterWidgetShadow),
inputBoxStyles: defaultInputBoxStyles,
toggleStyles: defaultToggleStyles,
};
export const defaultCountBadgeStyles = getCountBadgeStyle({});
export function getCountBadgeStyle(override) {
return {
badgeBackground: asCssValue(override.badgeBackground ?? badgeBackground),
badgeForeground: asCssValue(override.badgeForeground ?? badgeForeground),
badgeBorder: asCssValue(contrastBorder),
};
}
export const defaultBreadcrumbsWidgetStyles = getBreadcrumbsWidgetStyles({});
export function getBreadcrumbsWidgetStyles(override) {
return {
breadcrumbsBackground: asCssValue(override.breadcrumbsBackground ?? breadcrumbsBackground),
breadcrumbsForeground: asCssValue(override.breadcrumbsForeground ?? breadcrumbsForeground),
breadcrumbsHoverForeground: asCssValue(override.breadcrumbsFocusForeground ?? breadcrumbsFocusForeground),
breadcrumbsFocusForeground: asCssValue(override.breadcrumbsFocusForeground ?? breadcrumbsFocusForeground),
breadcrumbsFocusAndSelectionForeground: asCssValue(
override.breadcrumbsFocusAndSelectionForeground ?? breadcrumbsActiveSelectionForeground,
),
};
}