continue to fix preferences styles

This commit is contained in:
Cassie Tarakajian 2017-11-14 15:27:00 -05:00
parent 9587d01908
commit ca80308bc2
6 changed files with 230 additions and 190 deletions

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100px" height="100px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<g>
<path d="M76.002,52.608c0,14.32-11.681,26.001-26.001,26.001c-14.4,0-26-11.681-26-26.001c0-14.4,11.6-26,26-26
C64.321,26.608,76.002,38.208,76.002,52.608z M54.641,39.168c0-2.48-2-4.48-4.56-4.48c-2.56,0-4.56,2-4.56,4.48
c0,2.56,2,4.64,4.56,4.64C52.641,43.808,54.641,41.808,54.641,39.168z M54.001,45.968h-7.76v22.481h7.76V45.968z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 828 B

View file

@ -8,6 +8,7 @@ import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
const plusUrl = require('../../../images/plus.svg'); const plusUrl = require('../../../images/plus.svg');
const minusUrl = require('../../../images/minus.svg'); const minusUrl = require('../../../images/minus.svg');
const beepUrl = require('../../../sounds/audioAlert.mp3'); const beepUrl = require('../../../sounds/audioAlert.mp3');
const infoUrl = require('../../../images/information.svg');
class Preferences extends React.Component { class Preferences extends React.Component {
constructor(props) { constructor(props) {
@ -88,6 +89,17 @@ class Preferences extends React.Component {
checked={this.props.theme === 'dark'} checked={this.props.theme === 'dark'}
/> />
<label htmlFor="dark-theme-on" className="preference__option">Dark</label> <label htmlFor="dark-theme-on" className="preference__option">Dark</label>
<input
type="radio"
onChange={() => this.props.setTheme('contrast')}
aria-label="high contrast theme on"
name="high contrast theme"
id="high-contrast-theme-on"
className="preference__radio-button"
value="contrast"
checked={this.props.theme === 'contrast'}
/>
<label htmlFor="high-contrast-theme-on" className="preference__option">High Contrast</label>
</div> </div>
</div> </div>
<div className="preference"> <div className="preference">
@ -205,26 +217,31 @@ class Preferences extends React.Component {
</div> </div>
</TabPanel> </TabPanel>
<TabPanel> <TabPanel>
<br></br> {/* <div className="preference">
<div className="preference">
<h4 className="preference__title">Add a p5.js or an external library</h4> <h4 className="preference__title">Add a p5.js or an external library</h4>
<h4 className="preference__add__resource">Add a script library resource field</h4> </div> */}
<div className="preference">
<h4 className="preference__title">Security Protocol</h4> <h4 className="preference__title">Security Protocol</h4>
{ <div className="preference__serve-secure">
this.props.currentUser == null ? <input
null : id="serve-secure"
<div className="toolbar__serve-secure"> type="checkbox"
<input checked={this.props.serveSecure || false}
id="serve-secure" onChange={(event) => {
type="checkbox" this.props.setServeSecure(event.target.checked);
checked={this.props.project.serveSecure || false} }}
onChange={(event) => { />
this.props.setServeSecure(event.target.checked); <label htmlFor="serve-secure">Serve over HTTPS</label>
}} <span
/> className="serve-secture__tooltip tooltipped tooltipped-n tooltipped-no-delay tooltipped-multiline"
</div> aria-label={'Choose HTTPS if you need to \n • access a microphone or webcam \n'
} + '• access an API served over HTTPS \n\n'
<h4 className="serve__over__https">Serve over HTTPS</h4> + 'Choose HTTP if you need to \n'
+ '• access an API served over HTTP'}
>
<InlineSVG src={infoUrl} className="serve-secure__icon" />
</span>
</div>
</div> </div>
</TabPanel> </TabPanel>
<TabPanel> <TabPanel>
@ -321,14 +338,8 @@ Preferences.propTypes = {
setLintWarning: PropTypes.func.isRequired, setLintWarning: PropTypes.func.isRequired,
// openTab: PropTypes.func.isRequired, // openTab: PropTypes.func.isRequired,
theme: PropTypes.string.isRequired, theme: PropTypes.string.isRequired,
serveSecure: PropTypes.bool.isRequired,
setServeSecure: PropTypes.func.isRequired, setServeSecure: PropTypes.func.isRequired,
currentUser: PropTypes.string,
project: PropTypes.shape({
name: PropTypes.string.isRequired,
isEditingName: PropTypes.bool,
id: PropTypes.string,
serveSecure: PropTypes.bool,
}).isRequired,
setTheme: PropTypes.func.isRequired setTheme: PropTypes.func.isRequired
}; };

View file

@ -272,6 +272,8 @@ class IDEView extends React.Component {
setSoundOutput={this.props.setSoundOutput} setSoundOutput={this.props.setSoundOutput}
theme={this.props.preferences.theme} theme={this.props.preferences.theme}
setTheme={this.props.setTheme} setTheme={this.props.setTheme}
serveSecure={this.props.project.serveSecure}
setServeSecure={this.props.setServeSecure}
/> />
</Overlay> </Overlay>
} }

View file

@ -40,7 +40,7 @@
color: getThemifyVariable('button-hover-color'); color: getThemifyVariable('button-hover-color');
} }
font-family: Montserrat, sans-serif; font-family: Montserrat, sans-serif;
font-size: #{14 / $base-font-size}rem; font-size: #{12 / $base-font-size}rem;
} }
.tooltipped-n::before, .tooltipped-n::before,

View file

@ -29,7 +29,7 @@
.overlay__header { .overlay__header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: #{30 / $base-font-size}rem #{20 / $base-font-size}rem #{30 / $base-font-size}rem #{20 / $base-font-size}rem; padding: #{20 / $base-font-size}rem;
flex: 1 0 auto; flex: 1 0 auto;
} }

View file

@ -1,59 +1,59 @@
.preferences { .preferences {
width: 100%; width: 100%;
max-width: #{640 / $base-font-size}rem; min-width: #{640 / $base-font-size}rem;
z-index: 9999; max-width: 100%;
padding: #{14 / $base-font-size}rem #{20 / $base-font-size}rem #{2 / $base-font-size}rem #{20 / $base-font-size}rem ; min-height: #{460 / $base-font-size}rem;
display: flex; max-height: 100%;
flex-direction: column; z-index: 9999;
@include themify() { padding: 0 #{20 / $base-font-size}rem #{2 / $base-font-size}rem #{20 / $base-font-size}rem ;
background-color: getThemifyVariable('editor-gutter-color'); display: flex;
} flex-direction: column;
outline: none; outline: none;
} }
.preferences__exit-button { .preferences__exit-button {
@include icon(); @include icon();
padding-top: #{5 / $base-font-size}rem; padding-top: #{5 / $base-font-size}rem;
margin-right: #{-6 / $base-font-size}rem; margin-right: #{-6 / $base-font-size}rem;
} }
.preference__minus-button, .preference__minus-button,
.preference__plus-button { .preference__plus-button {
@include themify() { @include themify() {
@extend %preferences-button; @extend %preferences-button;
width: #{32 / $base-font-size}rem; width: #{32 / $base-font-size}rem;
height: #{32 / $base-font-size}rem; height: #{32 / $base-font-size}rem;
margin-left: #{6 / $base-font-size}rem; margin-left: #{6 / $base-font-size}rem;
margin-right: #{10 / $base-font-size}rem; margin-right: #{10 / $base-font-size}rem;
line-height: #{40 / $base-font-size}rem; line-height: #{40 / $base-font-size}rem;
& svg { & svg {
width: #{10 / $base-font-size}rem; width: #{10 / $base-font-size}rem;
} }
} }
} }
.serve__over__https { .serve__over__https {
text-align: center; text-align: center;
margin-left: #{9 / $base-font-size}rem; margin-left: #{9 / $base-font-size}rem;
font-width: #{108 / $base-font-size}rem; font-width: #{108 / $base-font-size}rem;
font-height: #{15 / $base-font-size}rem; font-height: #{15 / $base-font-size}rem;
font-family: Montserrat; font-family: Montserrat;
font-size: #{12 / $base-font-size}rem; font-size: #{12 / $base-font-size}rem;
margin-top: #{2 / $base-font-size}rem; margin-top: #{2 / $base-font-size}rem;
} }
.preferences__heading { .preferences__heading {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
@include themify() { @include themify() {
color: getThemifyVariable('heading-text-color'); color: getThemifyVariable('heading-text-color');
} }
} }
.preferences__title{ .preferences__title{
width: #{90 / $base-font-size}rem; width: #{90 / $base-font-size}rem;
height: #{25 / $base-font-size}rem; height: #{25 / $base-font-size}rem;
font-family: Montserrat; font-family: Montserrat;
font-size: #{21 / $base-font-size}rem; font-size: #{21 / $base-font-size}rem;
font-weight: bold; font-weight: bold;
@ -61,188 +61,204 @@
} }
.preference__subheadings { .preference__subheadings {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding-bottom: #{0.1 / $base-font-size}rem; padding-bottom: #{0.1 / $base-font-size}rem;
@include themify() { @include themify() {
border-bottom: 1px solid getThemifyVariable('button-border-color'); border-bottom: 1px solid getThemifyVariable('button-border-color');
} }
} }
.preference { .preference {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding-bottom: #{12 / $base-font-size}rem; padding-bottom: #{12 / $base-font-size}rem;
& + & { & + & {
@include themify() { @include themify() {
border-top: 1px dashed getThemifyVariable('button-border-color'); border-top: 1px dashed getThemifyVariable('button-border-color');
} }
} }
} }
.preference__title { .preference__title {
width: 100%; width: 100%;
font-size: #{16 / $base-font-size}rem; font-size: #{16 / $base-font-size}rem;
margin-top: #{13 / $base-font-size}rem; margin-top: #{13 / $base-font-size}rem;
margin-bottom: #{7 / $base-font-size}rem; margin-bottom: #{7 / $base-font-size}rem;
@include themify() { @include themify() {
color: getThemifyVariable('heading-text-color'); color: getThemifyVariable('heading-text-color');
} }
} }
.preference__subtitle { .preference__subtitle {
@include themify() { @include themify() {
color: getThemifyVariable('inactive-text-color'); color: getThemifyVariable('inactive-text-color');
} }
width: 100%; width: 100%;
margin-bottom: #{10 / $base-font-size}rem; margin-bottom: #{10 / $base-font-size}rem;
margin-top: 0; margin-top: 0;
} }
.preference__value { .preference__value {
@include themify() { @include themify() {
border: #{1 / $base-font-size}rem solid getThemifyVariable('button-border-color'); border: #{1 / $base-font-size}rem solid getThemifyVariable('button-border-color');
background-color: getThemifyVariable('button-background-color'); background-color: getThemifyVariable('button-background-color');
color: getThemifyVariable('input-text-color'); color: getThemifyVariable('input-text-color');
} }
text-align: center; text-align: center;
border-radius: 0%; border-radius: 0%;
outline: none; outline: none;
width: #{44 / $base-font-size}rem; width: #{44 / $base-font-size}rem;
height: #{40 / $base-font-size}rem; height: #{40 / $base-font-size}rem;
margin: 0 #{26 / $base-font-size}rem; margin: 0 #{26 / $base-font-size}rem;
padding: 0; padding: 0;
font-size: #{16 / $base-font-size}rem; font-size: #{16 / $base-font-size}rem;
font-family: Inconsolata; font-family: Inconsolata;
} }
.preference__label { .preference__label {
@include themify() { @include themify() {
color: getThemifyVariable('inactive-text-color'); color: getThemifyVariable('inactive-text-color');
&:hover { &:hover {
color: getThemifyVariable('primary-text-color'); color: getThemifyVariable('primary-text-color');
} }
} }
margin: #{-15 / $base-font-size}rem 0 0 #{-5 / $base-font-size}rem; margin: #{-15 / $base-font-size}rem 0 0 #{-5 / $base-font-size}rem;
font-size: #{9 / $base-font-size}rem; font-size: #{9 / $base-font-size}rem;
width: #{44 / $base-font-size}rem; width: #{44 / $base-font-size}rem;
} }
.react-tabs__tab--selected { .react-tabs__tab--selected {
@include themify() { @include themify() {
/*color: getThemifyVariable('primary-text-color');*/ border-bottom: #{4 / $base-font-size}rem solid getThemifyVariable('button-background-hover-color');
border-bottom: #{4 / $base-font-size}rem solid getThemifyVariable('button-background-hover-color'); }
color: pink;
}
} }
.react-tabs__tab--selected .preference__subheading { .react-tabs__tab--selected .preference__subheading {
@include themify() { @include themify() {
color: black !important; color: getThemifyVariable('primary-text-color');
} }
} }
.react-tabs__tab { .react-tabs__tab {
width: #{110 / $base-font-size}rem; text-align: center;
text-align: center; color: black;
color: black; display: flex;
align-items: center;
border-bottom: #{4 / $base-font-size}rem solid transparent;
& + & {
margin-left: #{45 / $base-font-size}rem;
}
} }
.preference__subheading { .preference__subheading {
@include themify() { @include themify() {
color: getThemifyVariable('inactive-text-color'); color: getThemifyVariable('inactive-text-color');
&:hover, &:focus{ &:hover, &:focus{
color: getThemifyVariable('primary-text-color'); color: getThemifyVariable('primary-text-color');
cursor: pointer; cursor: pointer;
} }
&:focus { &:focus {
color: getThemifyVariable('primary-text-color'); color: getThemifyVariable('primary-text-color');
cursor: pointer; cursor: pointer;
} }
} }
font-size: #{12 / $base-font-size}rem; font-size: #{12 / $base-font-size}rem;
height: #{25 / $base-font-size}rem; height: #{20 / $base-font-size}rem;
margin-left: #{5 / $base-font-size}rem; font-family: Montserrat;
margin-bottom: #{0.1 / $base-font-size}rem; width: 100%;
margin-right: #{60 / $base-font-size}rem; margin: 0;
padding-right: #{10 / $base-font-size}rem; padding: 0 #{5 /$base-font-size}rem;
font-family: Montserrat;
width: 100%;
} }
.preference__vertical-list { .preference__vertical-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: #{44 / $base-font-size}rem; width: #{44 / $base-font-size}rem;
padding-left: #{25 / $base-font-size}rem; padding-left: #{25 / $base-font-size}rem;
} }
.preference__add__resource { .preference__add__resource {
width: #{601 / $base-font-size}rem; font-family: Montserrat;
height: #{100 / $base-font-size}rem; font-size: #{14 / $base-font-size}rem;
font-family: Montserrat; line-height: 1.43;
font-size: #{14 / $base-font-size}rem; text-align: left;
line-height: 1.43; margin-left: #{5 / $base-font-size}rem;
text-align: left; margin-top: #{40 / $base-font-size}rem;
margin-left: #{5 / $base-font-size}rem; margin-bottom: #{10 / $base-font-size}rem;
margin-top: #{40 / $base-font-size}rem; @include themify() {
margin-bottom: #{10 / $base-font-size}rem; color: getThemifyVariable('inactive-text-color');
@include themify() { border-bottom: 1px dashed getThemifyVariable('button-border-color');
color: getThemifyVariable('inactive-text-color'); }
border-bottom: 1px dashed getThemifyVariable('button-border-color');
}
} }
.preference__radio-button { .preference__radio-button {
@extend %hidden-element; @extend %hidden-element;
} }
.preference__option { .preference__option {
@include themify() { @include themify() {
@extend %preference-option; @extend %preference-option;
padding-right: #{44 / $base-font-size}rem; padding-right: #{25 / $base-font-size}rem;
} }
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;
margin-top: #{10 / $base-font-size}rem; margin-top: #{10 / $base-font-size}rem;
width: #{50 / $base-font-size}rem; margin-left: #{5 / $base-font-size}rem;
margin-left: #{5 / $base-font-size}rem;
} }
.preference__option:last-child { .preference__option:last-child {
padding-right: 0; padding-right: 0;
} }
.preference__preview-button { .preference__preview-button {
@include themify() { @include themify() {
@extend %preference-option; @extend %preference-option;
&:hover { &:hover {
color: getThemifyVariable('button-background-hover-color'); color: getThemifyVariable('button-background-hover-color');
} }
} }
margin-top: #{7 / $base-font-size}rem; margin-top: #{7 / $base-font-size}rem;
margin-left: #{30 / $base-font-size}rem; margin-left: #{30 / $base-font-size}rem;
} }
.preference__options { .preference__options {
display: flex; display: flex;
} }
.preference__radio-button:checked + .preference__option { .preference__radio-button:checked + .preference__option {
@include themify() { @include themify() {
//for some reason this won't work for getThemifyVariable //for some reason this won't work for getThemifyVariable
color: map-get($theme-map, 'primary-text-color'); color: map-get($theme-map, 'primary-text-color');
} }
} }
.preference--hidden { .preference--hidden {
@extend %hidden-element; @extend %hidden-element;
} }
.preference__option.preference__canvas:not(:last-child) { .preference__option.preference__canvas:not(:last-child) {
padding-right: #{14 / $base-font-size}rem; padding-right: #{14 / $base-font-size}rem;
}
.preference__serve-secure {
display: flex;
align-items: center;
}
.serve-secure__icon {
@include icon();
& svg {
height: #{24 / $base-font-size}rem;
width: #{24 / $base-font-size}rem;
}
}
.serve-secture__tooltip:after {
text-align: left;
font-size: #{12 / $base-font-size}rem;
} }