Skip to content

Conversation

@omgaz
Copy link
Member

@omgaz omgaz commented Oct 14, 2019

This PR updates some of the early styles in the library, also bumped Storybook version to latest.

Fonts updated to Raleway

fonts

Blockquote styles updated

blockquote

Link styles updated

link

Added count badge component

countbadge

Copy link
Member Author

@omgaz omgaz left a 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';
Copy link
Member Author

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,
Copy link
Member Author

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 ? (
Copy link
Member Author

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%);
Copy link
Member Author

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:

  1. Don't support is--attached
  2. 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 {
Copy link
Member Author

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; */
Copy link
Member Author

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;
Copy link
Member Author

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');
Copy link
Member Author

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.

@omgaz omgaz self-assigned this Oct 16, 2019
@omgaz omgaz added accepted enhancement New feature or request labels Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants