-
Notifications
You must be signed in to change notification settings - Fork 0
Style updates #1
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
base: master
Are you sure you want to change the base?
Conversation
omgaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes needed.
| import React, { Fragment } from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
|
|
||
| import './styles.css'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create an issue for styled components
|
|
||
| const CountBadge = ({ | ||
| children, | ||
| hideCount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isCountHidden
| size, | ||
| }) => { | ||
| const count = | ||
| children > 99 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic numbers. Replace with const maxDisplayableCount = 99;
| position: absolute; | ||
| top: 0; | ||
| right: 0; | ||
| transform: translate(55%, -55%); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that this relies on the outer element having a position relative which doesn't encapsulate this component - it creates a dependency on the outside world rather than being atomic.
Options:
- Don't support
is--attached - Find parent and bind to position using
getBoundingClientRect.
Obviously option 2 will have a impact on performance, so should consider looking at stifling re-renders.
For now, let's remove this feature and open an issue to investigate and add.
| transform: translate(55%, -55%); | ||
| } | ||
|
|
||
| .CountBadge::after { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we leave some more comments in the CSS as to what the intent of the pseudo class is.
| /* font-family: 'Montserrat', sans-serif; | ||
| line-height: 1.5; | ||
| font-weight: 800; | ||
| font-weight: 800; */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up comment
| line-height: 2.5rem; | ||
| font-weight: 400; | ||
| text-transform: uppercase; | ||
| letter-spacing: 1px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rem?
| @@ -1,6 +1,8 @@ | |||
| @import url('https://fonts.googleapis.com/css?family=Raleway:200,400,600|Source+Code+Pro&display=swap'); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this, are we using 600 or 700? I think we need 700.
This PR updates some of the early styles in the library, also bumped Storybook version to latest.
Fonts updated to Raleway
Blockquote styles updated
Link styles updated
Added count badge component