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

Weight loss program #787

Merged
merged 17 commits into from
Jun 4, 2017
Merged

Weight loss program #787

merged 17 commits into from
Jun 4, 2017

Conversation

samanpwbb
Copy link
Contributor

@samanpwbb samanpwbb commented Jun 2, 2017

This is ready to go. Decided against drastic conceptual changes.

// mb-pages
CSS: 262 kB (minified) => 29.7 kB (gzipped)
SVG: 50 kB => 15.1 kB (gzipped)

// This branch
CSS: 172 kB (minified) => 21.9 kB (gzipped)
SVG: 50 kB => 15.1 kB (gzipped)


This branch turned into a larger v1 push, beyond just space saving. Changes:

  • Adds missing --dark modifiers to some typography rules.
  • Stroked buttons and select elements now have a 1px stroke by default.
  • Adds new btn--stroked--2 and select--stroked--2 modifier classes to create stroked buttons and select elements that have 2px strokes.
  • [internal only] Renames neutral variables to more meaningful disabled-{type}-interactive variables.
  • Darken the gray-faint color to #e5e5e5 so it's legible on a wider range of monitors.
  • Removes teal color variations.
  • Removes 600px layout scale value for padding and margin.
  • Refactors range inputs to use currentColor for coloring, which save space
  • Removes darken5 and lighten5 color variations to save space and encourage more accessible design.
  • Removes p{n} and m{n} rules.
  • Limits the possible colors available for form elements for accessibility reasons and to save size. -faint or -light form elements are no longer available for any element, and darken10 and darken10 are no longer available for any for element except buttons.
  • Adds distinct hover states for active checkboxes and radio inputs.
  • Redesigns checkbox according to Reconsider active checkbox style #745.

@samanpwbb
Copy link
Contributor Author

samanpwbb commented Jun 4, 2017

@tristen @davidtheclark this is ready for review.

Copy link
Member

@tristen tristen left a comment

Choose a reason for hiding this comment

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

Changes look great!

Decided against drastic conceptual changes

By that do you mean reducing color variations on form elements to two states?

@@ -84,12 +78,12 @@ class Toggles extends React.Component {
</div>

<div className='mb12 txt-bold color-darken50 txt-uppercase txt-s'>Light variations</div>
<div className='bg-gray round p12y mt12'>
<div className='bg-gray round px12 py12y mt12'>
Copy link
Member

Choose a reason for hiding this comment

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

Should be py12

{lightenColors.map((c) => <ToggleEl key={c} color={c} />)}
</div>

<div className='mt24 mb12 txt-bold color-darken50 txt-uppercase txt-s'>Disabled and light</div>
<div className='bg-gray round p12y mt12'>
<div className='bg-gray round px12 py12y mt12'>
Copy link
Member

Choose a reason for hiding this comment

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

Should be py12

@@ -9,7 +9,7 @@ const playback = `<div class='flex-parent flex-parent--row flex-parent--center-c
<button class='flex-child py18 pr12 pl18 border-r border--gray-light bg-white bg-green-faint-on-hover cursor-pointer round-l'>
<div class='triangle--r triangle color-green color-green'></div>
</button>
<div class='flex-child flex-child--grow p18 bg-white'>
<div class='flex-child flex-child--grow px18 py18bg-white'>
Copy link
Member

Choose a reason for hiding this comment

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

Missing space between class names

<span class='flex-child triangle triangle--d'></span>
</div>`;

const basic_right = `<div class='flex-parent-inline flex-parent--center-cross'>
<span class='flex-child triangle triangle--l'></span>
<div class='flex-child p6 round txt-bold txt-s align-center bg-darken75 color-white'>Hello world!</div>
<div class='flex-child px6 py6round txt-bold txt-s align-center bg-darken75 color-white'>Hello world!</div>
Copy link
Member

Choose a reason for hiding this comment

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

Missing space between class names

</div>`;

const basic_left = `<div class='flex-parent-inline flex-parent--center-cross'>
<div class='flex-child p6 round txt-bold txt-s align-center bg-darken75 color-white'>Hello world!</div>
<div class='flex-child px6 py6round txt-bold txt-s align-center bg-darken75 color-white'>Hello world!</div>
Copy link
Member

Choose a reason for hiding this comment

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

Missing space between class names

<span class='flex-child triangle triangle--r'></span>
</div>`;

const basic_with_closure = `<div class='flex-parent-inline flex-parent--center-cross flex-parent--column'>
<div class='flex-child relative p18 round txt-bold txt-s align-center bg-darken75 color-white'>
<div class='flex-child relative px18 py18round txt-bold txt-s align-center bg-darken75 color-white'>
Copy link
Member

Choose a reason for hiding this comment

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

Missing space between class names

border: 1px solid var(--lighten10);
line-height: 18px;
border-radius: 3px;
padding: 2px 3px;
Copy link
Member

Choose a reason for hiding this comment

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

Was dropping these properties intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, prose--dark is a modifier for prose so no need to duplicate these rules.

"neutral45": "rgba(127, 127, 127, 0.45)",
"disabled-primary-interactive-color": "rgba(127, 127, 127, 0.25)",
"disabled-secondary-interactive-color": "rgba(127, 127, 127, 0.1)",
"disabled-text-color": "rgba(127, 127, 127, 0.45)",
Copy link
Member

Choose a reason for hiding this comment

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

Is disabled accurate? This is used for placeholder too right? And I'm not sure how primary & secondary align with how they are used. How about input-{value}-on-blur?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh that is the one inaccurate use. I can change this to be 'placeholder-text-color'

'gray',
'gray-dark',
Copy link
Member

Choose a reason for hiding this comment

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

Curious about all these gray-{varient} omissions? They ... still exist but you're removing them from the catalog?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a fix - we never had -dark variants here.

@samanpwbb
Copy link
Contributor Author

Addressed feedback!

'darken10',
'darken25',
'darken50',
'darken75',

'lighten5',
Copy link
Contributor

Choose a reason for hiding this comment

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

I like these cuts!


function isNotSuitableForButtons(color) {
// Filled Buttons should be allowed to have subtle backgrounds within reason.
return color === 'black' || /(-faint|-dark)$/.test(color);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉


input:checked + .switch--dot-${color}::after {
background-color: var(--${color});
}
`);
}, '');
};

variantGenerators.range = function (colors) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Dark and non-dark ranges seem to look the same:

screen shot 2017-06-04 at 8 22 01 am

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch - was from an earlier refactor attempt. I removed this class but didn't remove the documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

// Do not create form elements from values that are too light or too dark,
// for accessibility and to save space.
return color === 'black' || /^(darken10|lighten10)$/.test(color) || /(-dark|-light|-faint)$/.test(color);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you about think -faint for hover and active states? Should we keep those, or also remove them to encourage stronger contrast?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd be in favor of cutting them - can add that to this PR

@davidtheclark
Copy link
Contributor

Since a lot changes here, might be useful to add a Changelog modifications in this PR.

@samanpwbb
Copy link
Contributor Author

@tristen @davidtheclark oookay i think this is ready for a final 👀 then merge

@samanpwbb samanpwbb changed the title [not ready] Weight loss program Weight loss program Jun 4, 2017
Copy link
Contributor

@davidtheclark davidtheclark left a comment

Choose a reason for hiding this comment

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

All these changes seem wonderful to me! Very fine work.

@samanpwbb samanpwbb merged commit 4831ad6 into dev-pages Jun 4, 2017
@samanpwbb samanpwbb deleted the weight-loss-program branch June 4, 2017 21:12
davidtheclark pushed a commit that referenced this pull request Jul 2, 2017
See changes in changelog.md
samanpwbb added a commit that referenced this pull request Jul 5, 2017
* adjust icon sizing, add icon-wrapper class, closes #763

* rename icon-wrapper to icon-inliner, other small fixes

* force txt-bold to be 1em line height, fixes line height offsets, closes #775

* rework size scale, closes #749

* Add limiter class, consistify scale even more

* only single-declaration utility classes should have important (#785)

* New copy of Open Sans (#786)

Reverts prior line-height change to bold weight.

Closes #775.

* reset abbr text-decoration, fixes txt-abbr rule (#788)

* Weight loss program (#787)

See changes in changelog.md

* Lighten gray-faint and add a line of caution to color documentation

* Reintroduce darken5 and lighten5 for backgrounds only

* Add icons option to build script (#794)

options.icons is an array of icon names. If this option is used, only icon names that match options.icons will be included in Assembly. Closes #782

* adds color and hover state to prose links (#798)

* Make uglify-js a real dependency

Closes #800.

* add unprose class, closes #793 (#795)

* add select--xs class to match btn--xs (#811)

* fix spin animation utility (#812)

closes #790

* prepare v0.14.0 (#813)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants