Allowing themes overriding by each project needs

This commit is contained in:
Bruno Alves de Faria 2017-03-07 20:10:19 -03:00
parent c7f31ddb0a
commit 04e9a85def
14 changed files with 90 additions and 49 deletions

View File

@ -3,3 +3,4 @@
@import "{ohif:design}/styles/imports/spacings" @import "{ohif:design}/styles/imports/spacings"
@import "{ohif:design}/styles/imports/variables" @import "{ohif:design}/styles/imports/variables"
@import "{ohif:design}/styles/imports/theme-icons" @import "{ohif:design}/styles/imports/theme-icons"
@import "{ohif:design}/styles/imports/theming"

View File

@ -5,13 +5,15 @@ Package.describe({
}); });
Package.onUse(function(api) { Package.onUse(function(api) {
api.versionsFrom('1.3.5.1'); api.versionsFrom('1.4.2.3');
api.use('ecmascript'); api.use('ecmascript');
api.use('standard-app-packages'); api.use('standard-app-packages');
api.use('jquery'); api.use('jquery');
api.use('stylus'); api.use('stylus');
api.use('ohif:themes');
api.addAssets('assets/theme-icons.png', 'client'); api.addAssets('assets/theme-icons.png', 'client');
// Importable colors / typography settings // Importable colors / typography settings
@ -21,14 +23,7 @@ Package.onUse(function(api) {
'styles/imports/spacings.styl', 'styles/imports/spacings.styl',
'styles/imports/variables.styl', 'styles/imports/variables.styl',
'styles/imports/theming.styl', 'styles/imports/theming.styl',
'styles/imports/theme-icons.styl', 'styles/imports/theme-icons.styl'
'styles/imports/themes/theme-tide.styl',
'styles/imports/themes/theme-tigerlily.styl',
'styles/imports/themes/theme-crickets.styl',
'styles/imports/themes/theme-honeycomb.styl',
'styles/imports/themes/theme-mint.styl',
'styles/imports/themes/theme-overcast.styl',
'styles/imports/themes/theme-quartz.styl'
], 'client', { ], 'client', {
isImport: true isImport: true
}); });

View File

@ -1,14 +1,4 @@
$themes = {} @require "{ohif:themes}/themes"
$defaultTheme = 'tide'
// Import the theme variables
@import "./themes/theme-tide.styl"
@import "./themes/theme-tigerlily.styl"
@import "./themes/theme-crickets.styl"
@import "./themes/theme-honeycomb.styl"
@import "./themes/theme-mint.styl"
@import "./themes/theme-overcast.styl"
@import "./themes/theme-quartz.styl"
/* /*
* Process each theme variable in the given value, splitting it by space * Process each theme variable in the given value, splitting it by space

View File

@ -0,0 +1,25 @@
Package.describe({
name: 'ohif:themes-common',
summary: 'OHIF Common Themes',
version: '0.0.1'
});
Package.onUse(function(api) {
api.versionsFrom('1.4.2.3');
api.use('stylus');
// Importable themes
api.addFiles([
'themes.styl',
'themes/theme-tide.styl',
'themes/theme-tigerlily.styl',
'themes/theme-crickets.styl',
'themes/theme-honeycomb.styl',
'themes/theme-mint.styl',
'themes/theme-overcast.styl',
'themes/theme-quartz.styl'
], 'client', {
isImport: true
});
});

View File

@ -0,0 +1,10 @@
$ohifThemesCommon = {}
// Import the theme variables
@import "{ohif:themes-common}/themes/theme-tide.styl"
@import "{ohif:themes-common}/themes/theme-tigerlily.styl"
@import "{ohif:themes-common}/themes/theme-crickets.styl"
@import "{ohif:themes-common}/themes/theme-honeycomb.styl"
@import "{ohif:themes-common}/themes/theme-mint.styl"
@import "{ohif:themes-common}/themes/theme-overcast.styl"
@import "{ohif:themes-common}/themes/theme-quartz.styl"

View File

@ -1,9 +1,9 @@
$themes['crickets'] = { $ohifThemesCommon['crickets'] = {
// Common pallete // Common palette
$uiYellow: #E29E4A $uiYellow: #E29E4A
$uiSkyBlue: #6FBDE2 $uiSkyBlue: #6FBDE2
// State pallete // State palette
$uiStateError: #FFCCCC $uiStateError: #FFCCCC
$uiStateErrorBorder: #993333 $uiStateErrorBorder: #993333
$uiStateErrorText: #661111 $uiStateErrorText: #661111
@ -25,7 +25,7 @@ $themes['crickets'] = {
$boxBackgroundColor: #344a61 $boxBackgroundColor: #344a61
// Text Colors // Text Colors
$textColorActive: black $textColorActive: #000000
$textPrimaryColor: #ffffff $textPrimaryColor: #ffffff
$textSecondaryColor: #8BE7B5 $textSecondaryColor: #8BE7B5
$largeNumbersColor: #D47C66 $largeNumbersColor: #D47C66

View File

@ -1,9 +1,9 @@
$themes['honeycomb'] = { $ohifThemesCommon['honeycomb'] = {
// Common pallete // Common palette
$uiYellow: #E29E4A $uiYellow: #E29E4A
$uiSkyBlue: #6FBDE2 $uiSkyBlue: #6FBDE2
// State pallete // State palette
$uiStateError: #FFCCCC $uiStateError: #FFCCCC
$uiStateErrorBorder: #993333 $uiStateErrorBorder: #993333
$uiStateErrorText: #661111 $uiStateErrorText: #661111
@ -25,11 +25,11 @@ $themes['honeycomb'] = {
$boxBackgroundColor: #344a61 $boxBackgroundColor: #344a61
// Text Colors // Text Colors
$textColorActive: black $textColorActive: #000000
$textPrimaryColor: #ffffff $textPrimaryColor: #ffffff
$textSecondaryColor: #FAB797 $textSecondaryColor: #FAB797
$largeNumbersColor: #D47C66 $largeNumbersColor: #D47C66
// Other Colors // Other Colors
$imageSliderColor: #163239 $imageSliderColor: #163239
} }

View File

@ -1,9 +1,9 @@
$themes['mint'] = { $ohifThemesCommon['mint'] = {
// Common pallete // Common palette
$uiYellow: #E29E4A $uiYellow: #E29E4A
$uiSkyBlue: #6FBDE2 $uiSkyBlue: #6FBDE2
// State pallete // State palette
$uiStateError: #FFCCCC $uiStateError: #FFCCCC
$uiStateErrorBorder: #993333 $uiStateErrorBorder: #993333
$uiStateErrorText: #661111 $uiStateErrorText: #661111
@ -25,7 +25,7 @@ $themes['mint'] = {
$boxBackgroundColor: #344a61 $boxBackgroundColor: #344a61
// Text Colors // Text Colors
$textColorActive: black $textColorActive: #000000
$textPrimaryColor: #ffffff $textPrimaryColor: #ffffff
$textSecondaryColor: #A7E9B3 $textSecondaryColor: #A7E9B3
$largeNumbersColor: #76D27D $largeNumbersColor: #76D27D

View File

@ -1,9 +1,9 @@
$themes['overcast'] = { $ohifThemesCommon['overcast'] = {
// Common pallete // Common palette
$uiYellow: #E29E4A $uiYellow: #E29E4A
$uiSkyBlue: #6FBDE2 $uiSkyBlue: #6FBDE2
// State pallete // State palette
$uiStateError: #FFCCCC $uiStateError: #FFCCCC
$uiStateErrorBorder: #993333 $uiStateErrorBorder: #993333
$uiStateErrorText: #661111 $uiStateErrorText: #661111
@ -25,7 +25,7 @@ $themes['overcast'] = {
$boxBackgroundColor: #344a61 $boxBackgroundColor: #344a61
// Text Colors // Text Colors
$textColorActive: black $textColorActive: #000000
$textPrimaryColor: #ffffff $textPrimaryColor: #ffffff
$textSecondaryColor: #73F2FC $textSecondaryColor: #73F2FC
$largeNumbersColor: #74F1FA $largeNumbersColor: #74F1FA

View File

@ -1,9 +1,9 @@
$themes['quartz'] = { $ohifThemesCommon['quartz'] = {
// Common pallete // Common palette
$uiYellow: #E29E4A $uiYellow: #E29E4A
$uiSkyBlue: #6FBDE2 $uiSkyBlue: #6FBDE2
// State pallete // State palette
$uiStateError: #FFCCCC $uiStateError: #FFCCCC
$uiStateErrorBorder: #993333 $uiStateErrorBorder: #993333
$uiStateErrorText: #661111 $uiStateErrorText: #661111
@ -25,7 +25,7 @@ $themes['quartz'] = {
$boxBackgroundColor: #344a61 $boxBackgroundColor: #344a61
// Text Colors // Text Colors
$textColorActive: black $textColorActive: #000000
$textPrimaryColor: #ffffff $textPrimaryColor: #ffffff
$textSecondaryColor: #D7E8FE $textSecondaryColor: #D7E8FE
$largeNumbersColor: #ABCDF6 $largeNumbersColor: #ABCDF6

View File

@ -1,9 +1,9 @@
$themes['tide'] = { $ohifThemesCommon['tide'] = {
// Common pallete // Common palette
$uiYellow: #E29E4A $uiYellow: #E29E4A
$uiSkyBlue: #6FBDE2 $uiSkyBlue: #6FBDE2
// State pallete // State palette
$uiStateError: #FFCCCC $uiStateError: #FFCCCC
$uiStateErrorBorder: #993333 $uiStateErrorBorder: #993333
$uiStateErrorText: #661111 $uiStateErrorText: #661111
@ -25,7 +25,7 @@ $themes['tide'] = {
$boxBackgroundColor: #344a61 $boxBackgroundColor: #344a61
// Text Colors // Text Colors
$textColorActive: black $textColorActive: #000000
$textPrimaryColor: #ffffff $textPrimaryColor: #ffffff
$textSecondaryColor: #91B9CD $textSecondaryColor: #91B9CD
$largeNumbersColor: #6FBDE2 $largeNumbersColor: #6FBDE2

View File

@ -1,9 +1,9 @@
$themes['tigerlily'] = { $ohifThemesCommon['tigerlily'] = {
// Common pallete // Common palette
$uiYellow: #E29E4A $uiYellow: #E29E4A
$uiSkyBlue: #6FBDE2 $uiSkyBlue: #6FBDE2
// State pallete // State palette
$uiStateError: #FFCCCC $uiStateError: #FFCCCC
$uiStateErrorBorder: #CC6666 $uiStateErrorBorder: #CC6666
$uiStateErrorText: #661111 $uiStateErrorText: #661111
@ -25,7 +25,7 @@ $themes['tigerlily'] = {
$boxBackgroundColor: #5b3a59 $boxBackgroundColor: #5b3a59
// Text Colors // Text Colors
$textColorActive: black $textColorActive: #000000
$textPrimaryColor: #ffffff $textPrimaryColor: #ffffff
$textSecondaryColor: #9CCDF8 $textSecondaryColor: #9CCDF8
$largeNumbersColor: #D47C66 $largeNumbersColor: #D47C66

View File

@ -0,0 +1,16 @@
Package.describe({
name: 'ohif:themes',
summary: 'OHIF Themes overridable package',
version: '0.0.1'
});
Package.onUse(function(api) {
api.versionsFrom('1.4.2.3');
api.use('stylus');
api.use('ohif:themes-common');
// Importable themes related variables
api.addFiles('themes.styl', 'client', { isImport: true });
});

View File

@ -0,0 +1,4 @@
@require "{ohif:themes-common}/themes"
$themes = $ohifThemesCommon
$defaultTheme = 'tide'