Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

feat(segment): add inverted prop and improved styles #389

Merged
merged 2 commits into from
Nov 12, 2018

Conversation

bmdalex
Copy link
Collaborator

@bmdalex bmdalex commented Oct 23, 2018

Segment

This PR introduces following changes for Segment component:

  • inverted prop;
  • color variable;
  • content slot and renderContent method;
  • new styles.

TODO

  • Conformance test
  • Minimal doc site example
  • Stardust base theme
  • Teams Light theme
  • Teams Dark theme
  • Teams Contrast theme
  • Confirm RTL usage
  • W3 accessibility check
  • Stardust accessibility check
  • Update glossary props table
  • Update the CHANGELOG.md

API Proposal

Default

<Segment
  content="The elevator to success is out of order. You’ll have to use the stairs."
/>

renders:

screen shot 2018-10-23 at 11 38 14

color variable

A segment can different colors. Use color variable to see the effect.

<Segment
  content="Colored segment."
  variables={siteVars => ({ color: siteVars.brand })}
/>

renders
screen shot 2018-10-23 at 11 38 20

inverted with color variable

A segment can have its colors inverted for contrast. Use color variable to see the effect.

<Segment
  inverted
  content={<Text content="Colored inverted segment." styles={{ color: 'white' }} />}
  variables={siteVars => ({ color: siteVars.brand })}
/>

renders
screen shot 2018-10-23 at 11 38 25

@codecov
Copy link

codecov bot commented Oct 23, 2018

Codecov Report

Merging #389 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #389      +/-   ##
==========================================
+ Coverage   88.96%   88.96%   +<.01%     
==========================================
  Files          41       41              
  Lines        1386     1387       +1     
  Branches      177      177              
==========================================
+ Hits         1233     1234       +1     
  Misses        149      149              
  Partials        4        4
Impacted Files Coverage Δ
src/components/Segment/Segment.tsx 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc4c67e...12eb4ac. Read the comment docs.

@bmdalex bmdalex force-pushed the feat/segment-inverted-prop branch 2 times, most recently from 4478bc8 to 53e4168 Compare October 23, 2018 09:53
Copy link
Contributor

@kuzhelov kuzhelov left a comment

Choose a reason for hiding this comment

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

please, consider to use fallback options for siteVars.brand for those cases where those are not provided. I would even suggest to use some hardcoded colors for now, to make it easier for the client of these examples to get the idea

@bmdalex bmdalex removed the needs author feedback Author's opinion is asked label Oct 24, 2018
@levithomason levithomason added needs author feedback Author's opinion is asked and removed ready for merge labels Oct 29, 2018
@bmdalex bmdalex force-pushed the feat/segment-inverted-prop branch 2 times, most recently from 6a30873 to 54ceaef Compare October 31, 2018 16:52
@bmdalex bmdalex added 🚀 ready for review and removed needs author feedback Author's opinion is asked labels Oct 31, 2018
@bmdalex
Copy link
Collaborator Author

bmdalex commented Nov 2, 2018

@mnajdova @kuzhelov @levithomason
bump for reviewing this

@bmdalex bmdalex force-pushed the feat/segment-inverted-prop branch 2 times, most recently from c835ce7 to b1be3b8 Compare November 7, 2018 18:38
Copy link
Member

@levithomason levithomason left a comment

Choose a reason for hiding this comment

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

Please merge after addressing comments!

@bmdalex bmdalex merged commit 2f71e12 into master Nov 12, 2018
@bmdalex bmdalex deleted the feat/segment-inverted-prop branch November 12, 2018 09:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants