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 ?
null :
<div className="toolbar__serve-secure">
<input <input
id="serve-secure" id="serve-secure"
type="checkbox" type="checkbox"
checked={this.props.project.serveSecure || false} checked={this.props.serveSecure || false}
onChange={(event) => { onChange={(event) => {
this.props.setServeSecure(event.target.checked); 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"
aria-label={'Choose HTTPS if you need to \n • access a microphone or webcam \n'
+ '• access an API served over HTTPS \n\n'
+ 'Choose HTTP if you need to \n'
+ '• access an API served over HTTP'}
>
<InlineSVG src={infoUrl} className="serve-secure__icon" />
</span>
</div> </div>
}
<h4 className="serve__over__https">Serve over HTTPS</h4>
</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,13 +1,13 @@
.preferences { .preferences {
width: 100%; width: 100%;
max-width: #{640 / $base-font-size}rem; min-width: #{640 / $base-font-size}rem;
max-width: 100%;
min-height: #{460 / $base-font-size}rem;
max-height: 100%;
z-index: 9999; z-index: 9999;
padding: #{14 / $base-font-size}rem #{20 / $base-font-size}rem #{2 / $base-font-size}rem #{20 / $base-font-size}rem ; padding: 0 #{20 / $base-font-size}rem #{2 / $base-font-size}rem #{20 / $base-font-size}rem ;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@include themify() {
background-color: getThemifyVariable('editor-gutter-color');
}
outline: none; outline: none;
} }
@ -131,22 +131,25 @@
.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 {
@ -162,13 +165,11 @@
} }
} }
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;
margin-bottom: #{0.1 / $base-font-size}rem;
margin-right: #{60 / $base-font-size}rem;
padding-right: #{10 / $base-font-size}rem;
font-family: Montserrat; font-family: Montserrat;
width: 100%; width: 100%;
margin: 0;
padding: 0 #{5 /$base-font-size}rem;
} }
.preference__vertical-list { .preference__vertical-list {
@ -179,8 +180,6 @@
} }
.preference__add__resource { .preference__add__resource {
width: #{601 / $base-font-size}rem;
height: #{100 / $base-font-size}rem;
font-family: Montserrat; font-family: Montserrat;
font-size: #{14 / $base-font-size}rem; font-size: #{14 / $base-font-size}rem;
line-height: 1.43; line-height: 1.43;
@ -201,13 +200,12 @@
.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;
} }
@ -245,5 +243,23 @@
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;
}