Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Separate input and select styles using Aphrodite #6689

Merged
merged 3 commits into from
Jan 23, 2017
Merged

Separate input and select styles using Aphrodite #6689

merged 3 commits into from
Jan 23, 2017

Conversation

bsclifton
Copy link
Member

@bsclifton bsclifton commented Jan 16, 2017

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

This is an Aphrodite friendly redo of #6084

Fixes #5972

I tested each area manually and did my best to compare to the original PR. @luixxiul, please let me know what you think. I did omit a two updates to select (because they looked bad):

  • select box font being 1em
  • select box having margin 0 5px

screenshots of textbox / dropdown

screen shot 2017-01-16 at 3 38 14 pm

screen shot 2017-01-16 at 3 39 27 pm

Updates to about:styles

screen shot 2017-01-16 at 3 41 08 pm

screen shot 2017-01-16 at 3 41 18 pm

@bsclifton bsclifton added the design A design change, especially one which needs input from the design team. label Jan 16, 2017
@bsclifton bsclifton added this to the 0.13.1 milestone Jan 16, 2017
@bsclifton bsclifton self-assigned this Jan 16, 2017
@bsclifton bsclifton changed the title Fix 5972 aphrodite Separate input and select styles using Aphrodite Jan 16, 2017
}

const styles = StyleSheet.create({
'formControl': {
Copy link
Contributor

@luixxiul luixxiul Jan 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we share this with that of app/renderer/components/dropdown.js, setting globally somewhere and importing it? I'm wondering if setting them in each file would make a possibility of style inconsistency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luixxiul we sure can; implemented this feedback with 46d07ec

@luixxiul
Copy link
Contributor

https://travis-ci.org/brave/browser-laptop/builds/192513240#L4619

SyntaxError: /home/travis/build/brave/browser-laptop/app/extensions/brave/img/caret_down_grey.svg: Unexpected token, expected } (1:90)

const {StyleSheet} = require('aphrodite')
const globalStyles = require('./global')

const styles = StyleSheet.create({
Copy link
Contributor

@luixxiul luixxiul Jan 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding these under this line for reference? Is it too much?

/*
app/renderer/components/dropdown.js
app/renderer/components/textbox.js
*/

@luixxiul
Copy link
Contributor

luixxiul commented Jan 17, 2017

Also I think we can remove some properties in LESS files thanks to the change. I'll mention them as below for a cleanup task.

const globalStyles = require('./global')

const styles = StyleSheet.create({
'formControl': {
Copy link
Contributor

@luixxiul luixxiul Jan 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.form-control {
display: block;
background: white;
border: solid 1px @lightGray;
border-radius: @borderRadius;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-sizing: border-box;
color: @darkGray;
font-size: 14.5px;
height: 2.25em;
outline: none;
padding: 0.4em;
width: 100%;
}

}
},
'isSettings': {
width: '280px'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boxShadow: 'none',
outline: 'none'
},
'recoveryKeys': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.firstRecoveryKey,
.secondRecoveryKey {
margin-bottom: 20px;
}

@@ -1248,16 +1219,17 @@ class PaymentsTab extends ImmutableComponent {
<td>
<SettingsList>
<SettingItem>
<select className='form-control fundsSelectBox'
<FormDropdown
Copy link
Contributor

@luixxiul luixxiul Jan 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsclifton Is this applied in some way?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no; I manually tested and it doesn't do anything (it still stays ~10px). Also, the "Add funds" button has a similar padding. If you remove padding from "Add funds" button (ex: set to 0), it looks bad

@luixxiul
Copy link
Contributor

Feedbacks left.

@bsclifton
Copy link
Member Author

@luixxiul I removed styles per your feedback; also I updated the Shields panel to use this new style:
screen shot 2017-01-23 at 10 14 41 am

Fixes #5972

- Create aphrodite components for "text" input type
- Create aphrodite components for "select" input type
- Small LESS updates to primary button (not Aphrodite component yet)
- Update about:styles

Auditors: @bbondy, @luixxiul, @cezaraugusto, @bradleyrichter
… panel to use new styles

- Updated selectors for testing shields
- added padding to dropdown to cover size of caret
- Fixed broken navigationBar test

Auditors: @luixxiul
@bsclifton bsclifton merged commit e69d86f into brave:0.13.1-branch Jan 23, 2017
@bsclifton bsclifton deleted the fix-5972-aphrodite branch January 23, 2017 19:17
bsclifton added a commit that referenced this pull request Jan 24, 2017
@luixxiul
Copy link
Contributor

I think the SVG merged with this PR is causing an error on Travis:

9) Preferences component "before all" hook:
     SyntaxError: /home/travis/build/brave/browser-laptop/app/extensions/brave/img/caret_down_grey.svg: Unexpected token, expected } (1:90)
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.86 17.81"><defs><style>.cls-1{fill:gray;}</style></defs><title>caret_down_grey</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1_copy" data-name="Layer 1 copy"><path class="cls-1" d="M15.3,17.35.49,2.77A1.62,1.62,0,0,1,1.62,0H31.24a1.62,1.62,0,0,1,1.14,2.77L17.57,17.35A1.62,1.62,0,0,1,15.3,17.35Z"/></g></g></svg>

@bsclifton
Copy link
Member Author

@luixxiul you are correct; I'm going to need some help w/ it. Let me ask around on Slack

bsclifton added a commit that referenced this pull request Jan 25, 2017
…nents for dropdown/textbox

(broke when #6689 was merged)

Auditors: @luixxiul, @bbondy
bsclifton added a commit that referenced this pull request Jan 25, 2017
bsclifton added a commit that referenced this pull request Jan 25, 2017
…nents for dropdown/textbox

(broke when #6689 was merged)

Auditors: @luixxiul, @bbondy
bsclifton added a commit that referenced this pull request Jan 25, 2017
bsclifton added a commit that referenced this pull request Jan 25, 2017
…nents for dropdown/textbox

(broke when #6689 was merged)

Auditors: @luixxiul, @bbondy
bsclifton added a commit that referenced this pull request Jan 26, 2017
bsclifton added a commit that referenced this pull request Jan 26, 2017
…nents for dropdown/textbox

(broke when #6689 was merged)

Auditors: @luixxiul, @bbondy
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design A design change, especially one which needs input from the design team. refactoring/aphrodite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants