Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Applab theme values to match design, create screens in current theme #28232

Merged
merged 1 commit into from May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 21 additions & 21 deletions apps/src/applab/designElements/button.jsx
Expand Up @@ -21,7 +21,6 @@ import * as elementUtils from './elementUtils';
import designMode from '../designMode';
import elementLibrary from './library';
import experiments from '../../util/experiments';
import {growToGridSize} from '../gridUtils';

class ButtonProperties extends React.Component {
static propTypes = {
Expand Down Expand Up @@ -218,12 +217,12 @@ export default {
ketchupAndMustard: 5,
lemonade: 6,
forest: 6,
watermelon: 10,
watermelon: 20,
area51: 10,
polar: 100,
polar: 20,
glowInTheDark: 10,
bubblegum: 100,
millennial: 100,
bubblegum: 20,
millennial: 20,
robot: 0,
classic: 0
},
Expand Down Expand Up @@ -268,19 +267,19 @@ export default {
classic: 'Arial'
},
fontSize: {
default: 18,
orange: 18,
citrus: 18,
ketchupAndMustard: 18,
lemonade: 18,
forest: 18,
watermelon: 18,
area51: 18,
polar: 18,
glowInTheDark: 18,
bubblegum: 18,
millennial: 18,
robot: 18,
default: 15,
orange: 15,
citrus: 15,
ketchupAndMustard: 15,
lemonade: 15,
forest: 15,
watermelon: 15,
area51: 15,
polar: 15,
glowInTheDark: 15,
bubblegum: 15,
millennial: 15,
robot: 15,
classic: 14
}
},
Expand All @@ -291,13 +290,14 @@ export default {
element.style.margin = '0px';
if (experiments.isEnabled('applabThemes')) {
element.style.borderStyle = 'solid';
// Roughly scale default size based on the current theme's font size:
const currentTheme = elementLibrary.getCurrentTheme(
designMode.activeScreen()
);
const fontSize = this.themeValues.fontSize[currentTheme];
element.style.height = `${growToGridSize(fontSize * 2)}px`;
element.style.width = `${10 + growToGridSize(fontSize * 5)}px`;
// Initial button size when fontSize is 14 or smaller is 80x30 (classic theme)
// Initial button size when fontSize is 15 or greater is 100x40 (new themes)
element.style.height = fontSize <= 14 ? '30px' : '40px';
element.style.width = fontSize <= 14 ? '80px' : '100px';
elementLibrary.applyCurrentTheme(element, designMode.activeScreen());
} else {
element.style.height = '30px';
Expand Down
34 changes: 17 additions & 17 deletions apps/src/applab/designElements/dropdown.jsx
Expand Up @@ -203,12 +203,12 @@ export default {
ketchupAndMustard: 5,
lemonade: 6,
forest: 6,
watermelon: 10,
watermelon: 20,
area51: 10,
polar: 100,
polar: 20,
glowInTheDark: 10,
bubblegum: 100,
millennial: 100,
bubblegum: 20,
millennial: 20,
robot: 0,
classic: 0
},
Expand Down Expand Up @@ -253,19 +253,19 @@ export default {
classic: 'Arial'
},
fontSize: {
default: 15,
orange: 15,
citrus: 15,
ketchupAndMustard: 15,
lemonade: 15,
forest: 15,
watermelon: 15,
area51: 15,
polar: 15,
glowInTheDark: 15,
bubblegum: 15,
millennial: 15,
robot: 15,
default: 13,
orange: 13,
citrus: 13,
ketchupAndMustard: 13,
lemonade: 13,
forest: 13,
watermelon: 13,
area51: 13,
polar: 13,
glowInTheDark: 13,
bubblegum: 13,
millennial: 13,
robot: 13,
classic: 14
}
},
Expand Down
32 changes: 16 additions & 16 deletions apps/src/applab/designElements/label.jsx
Expand Up @@ -203,14 +203,14 @@ export default {
default: 0,
orange: 0,
citrus: 2,
ketchupAndMustard: 200,
ketchupAndMustard: 10,
lemonade: 0,
forest: 2,
watermelon: 0,
area51: 20,
area51: 10,
polar: 2,
glowInTheDark: 0,
bubblegum: 100,
bubblegum: 10,
millennial: 4,
robot: 0,
classic: 0
Expand Down Expand Up @@ -256,19 +256,19 @@ export default {
classic: 'Arial'
},
fontSize: {
default: 15,
orange: 15,
citrus: 15,
ketchupAndMustard: 15,
lemonade: 15,
forest: 15,
watermelon: 15,
area51: 15,
polar: 15,
glowInTheDark: 15,
bubblegum: 15,
millennial: 15,
robot: 15,
default: 13,
orange: 13,
citrus: 13,
ketchupAndMustard: 13,
lemonade: 13,
forest: 13,
watermelon: 13,
area51: 13,
polar: 13,
glowInTheDark: 13,
bubblegum: 13,
millennial: 13,
robot: 13,
classic: 14
}
},
Expand Down
7 changes: 4 additions & 3 deletions apps/src/applab/designElements/screen.jsx
Expand Up @@ -178,10 +178,11 @@ export default {
element.style.position = 'absolute';
element.style.zIndex = 0;
if (experiments.isEnabled('applabThemes')) {
element.setAttribute(
'data-theme',
applabConstants.themeOptions[applabConstants.DEFAULT_THEME_INDEX]
// New screens are created with the same theme as is currently active
const currentTheme = elementLibrary.getCurrentTheme(
designMode.activeScreen()
);
element.setAttribute('data-theme', currentTheme);
elementLibrary.applyCurrentTheme(element, element);
}

Expand Down
26 changes: 13 additions & 13 deletions apps/src/applab/designElements/textInput.jsx
Expand Up @@ -271,19 +271,19 @@ export default {
classic: 'Arial'
},
fontSize: {
default: 15,
orange: 15,
citrus: 15,
ketchupAndMustard: 15,
lemonade: 15,
forest: 15,
watermelon: 15,
area51: 15,
polar: 15,
glowInTheDark: 15,
bubblegum: 15,
millennial: 15,
robot: 15,
default: 13,
orange: 13,
citrus: 13,
ketchupAndMustard: 13,
lemonade: 13,
forest: 13,
watermelon: 13,
area51: 13,
polar: 13,
glowInTheDark: 13,
bubblegum: 13,
millennial: 13,
robot: 13,
classic: 14
}
},
Expand Down
28 changes: 14 additions & 14 deletions apps/src/applab/designElements/textarea.jsx
Expand Up @@ -206,7 +206,7 @@ export default {
citrus: 4,
ketchupAndMustard: 5,
lemonade: 6,
forest: 8,
forest: 5,
watermelon: 20,
area51: 20,
polar: 8,
Expand Down Expand Up @@ -257,19 +257,19 @@ export default {
classic: 'Arial'
},
fontSize: {
default: 15,
orange: 15,
citrus: 15,
ketchupAndMustard: 15,
lemonade: 15,
forest: 15,
watermelon: 15,
area51: 15,
polar: 15,
glowInTheDark: 15,
bubblegum: 15,
millennial: 15,
robot: 15,
default: 13,
orange: 13,
citrus: 13,
ketchupAndMustard: 13,
lemonade: 13,
forest: 13,
watermelon: 13,
area51: 13,
polar: 13,
glowInTheDark: 13,
bubblegum: 13,
millennial: 13,
robot: 13,
classic: 14
}
},
Expand Down
22 changes: 11 additions & 11 deletions apps/src/applab/themeColor.js
Expand Up @@ -117,7 +117,7 @@ module.exports = {
default: '#4D575F',
orange: '#000000',
citrus: '#000000',
ketchupAndMustard: '#151F00',
ketchupAndMustard: '#193A55',
lemonade: '#FFFFFF',
forest: '#FFFFFF',
watermelon: '#151F00',
Expand All @@ -133,11 +133,11 @@ module.exports = {
default: '#000000',
orange: '#000000',
citrus: '#69883D',
ketchupAndMustard: '#151F00',
ketchupAndMustard: '#193A55',
lemonade: '#ACCFDE',
forest: '#000000',
forest: '#482F08',
watermelon: '#578B2E',
area51: '#C4ABFF',
area51: '#B394FF',
polar: '#ACCFDE',
glowInTheDark: '#5EFF5E',
bubblegum: '#FFFFFF',
Expand All @@ -147,7 +147,7 @@ module.exports = {
},
buttonBackground: {
default: '#FFA400',
orange: '#00ADBC',
orange: '#4BC6D0',
citrus: '#F7EC60',
ketchupAndMustard: '#F9DD54',
lemonade: '#5BB7E7',
Expand All @@ -165,7 +165,7 @@ module.exports = {
default: '#FFFFFF',
orange: '#FFFFFF',
citrus: '#000000',
ketchupAndMustard: '#151F00',
ketchupAndMustard: '#193A55',
lemonade: '#FFFFFF',
forest: '#FFFFFF',
watermelon: '#151F00',
Expand All @@ -181,11 +181,11 @@ module.exports = {
default: '#4D575F',
orange: '#FFFFFF',
citrus: '#69883D',
ketchupAndMustard: '#151F00',
ketchupAndMustard: '#193A55',
lemonade: '#ACCFDE',
forest: '#000000',
forest: '#482F08',
watermelon: '#578B2E',
area51: '#C4ABFF',
area51: '#B394FF',
polar: '#ACCFDE',
glowInTheDark: '#5EFF5E',
bubblegum: '#FFFFFF',
Expand Down Expand Up @@ -213,9 +213,9 @@ module.exports = {
default: '#4D575F',
orange: '#FFFFFF',
citrus: '#000000',
ketchupAndMustard: '#151F00',
ketchupAndMustard: '#193A55',
lemonade: '#00A8FF',
forest: '#65491D',
forest: '#482F08',
watermelon: '#151F00',
area51: '#C4ABFF',
polar: '#EFFAFF',
Expand Down