Skip to content

Commit

Permalink
fix(sdstheme): fix SDS Theme backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
masoudmanson committed May 3, 2024
1 parent d70cd2d commit 02398da
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 12 additions & 0 deletions packages/components/src/core/styles/common/SDSAppTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export const SDSAppTheme: AppTheme = {
s: 2,
},
fontWeights: {
bold: 700,
light: 300,
medium: 800,
regular: 400,
semibold: 600,
},
Expand Down Expand Up @@ -378,6 +381,15 @@ export const SDSAppTheme: AppTheme = {
},
};

/**
* (masoudmanson): This is to make sure that the old defaultAppTheme
* export is still available for backward compatibility.
*
* @deprecated
* Please use `SDSAppTheme` instead. This export will be removed in the future.
*/
export const defaultAppTheme = SDSAppTheme;

// (mlila) whenever our theme uses colors, we need to make sure we allow consuming
// applications to override those colors using their own custom theme.
// By defining borders using SDSAppTheme.colors instead of defaultThemeColors,
Expand Down
5 changes: 0 additions & 5 deletions packages/components/src/core/styles/common/defaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,3 @@ import { makeThemeOptions } from "./makeThemeOptions";
const defaultThemeOptions: SDSThemeOptions = makeThemeOptions(SDSAppTheme);

export const defaultTheme = createTheme(defaultThemeOptions);

/**
* (masoudmanson): This is to keep the old defaultAppTheme export for backward compatibility.
*/
export const defaultAppTheme = defaultTheme;
3 changes: 3 additions & 0 deletions packages/components/src/core/styles/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ export interface Typography {
}

export interface FontWeights {
bold: number;
light: number;
medium: number;
regular: number;
semibold: number;
}
Expand Down

0 comments on commit 02398da

Please sign in to comment.