Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

New inline link styling #707

Merged
merged 23 commits into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
54efb8d
WIP reith font fixes
May 31, 2019
ca3cd4d
testing things
Jun 1, 2019
786c393
CSS tweaks
Jun 11, 2019
8943c52
Merge branch 'latest' of github.com:bbc/psammead into WIP-reith-font-…
Jun 25, 2019
ce8231d
increase border padding on hover for High contrast modes
Jun 25, 2019
c2aa138
snapshot updates
Jun 25, 2019
6f1fbd4
site wide links will change elsewhere
Jun 25, 2019
66e9264
Merge branch 'latest' into new-inline-link-styling
Jun 25, 2019
247ad86
padding and minus margin buffer
Jun 25, 2019
4c68289
Merge branch 'latest' of github.com:bbc/psammead into new-inline-link…
Jun 25, 2019
3c310f5
Merge branch 'new-inline-link-styling' of github.com:bbc/psammead int…
Jun 25, 2019
c8d2878
Merge branch 'latest' into new-inline-link-styling
Jun 27, 2019
8d40848
Merge branch 'latest' into new-inline-link-styling
oluoluoxenfree Jun 27, 2019
5c7b510
changelog, package bump, psammead-styles bump
Jun 28, 2019
f549362
add note to inline-link story
Jun 28, 2019
3ddbfd8
Merge branch 'new-inline-link-styling' of github.com:bbc/psammead int…
Jun 28, 2019
e2f4d78
add note about border state change for high-contrast modes
Jun 28, 2019
f32a6e4
Merge branch 'latest' into new-inline-link-styling
Jul 1, 2019
c908bff
add link to issue for story update
Jul 1, 2019
63067b4
Merge branch 'latest' of github.com:bbc/psammead into new-inline-link…
Jul 1, 2019
be7ee92
Merge branch 'new-inline-link-styling' of github.com:bbc/psammead int…
Jul 1, 2019
cba915f
Merge branch 'latest' into new-inline-link-styling
Jul 2, 2019
30cfc26
pull latest and fix after conflicts
Jul 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/psammead-inline-link/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<! -- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 1.1.0 | [PR#719](https://github.com/bbc/psammead/pull/719) Updates the link styling to new UX designs |
| 1.0.0 | [PR#679](https://github.com/bbc/psammead/pull/679) Bump version number |
| 0.3.8 | [PR#498](https://github.com/bbc/psammead/pull/498) Update stories to use new input provider |
| 0.3.7 | [PR#424](https://github.com/bbc/psammead/pull/424) Add Snyk badge to readme |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/psammead-inline-link/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This component can be used at any point on a page.

Since this is just a `<a>` tag with associated styles, when you use this component, it has the same semantic meaning as a regular anchor element.

The font and background-color choices for each hover/focused/visited/default states meet WCAG AA colour contrast guidelines.
The font and background-color choices for each hover/focused/visited/default states meet WCAG AA colour contrast guidelines. Also the border width increases on hover and focus which acts as a visible change that is not colour dependent for high-contrast modes, which often override colours/styles.

## Contributing

Expand Down
10 changes: 5 additions & 5 deletions packages/components/psammead-inline-link/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/components/psammead-inline-link/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-inline-link",
"version": "1.0.0",
"version": "1.1.0",
"description": "React styled component for an Inline Link",
"main": "dist/index.js",
"repository": {
Expand All @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/bbc/psammead/blob/latest/packages/components/psammead-inline-link/README.md",
"dependencies": {
"@bbc/psammead-styles": "^0.2.1"
"@bbc/psammead-styles": "^1.0.0"
},
"devDependencies": {
"@bbc/psammead-storybook-helpers": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`InlineLink should render correctly 1`] = `
.c0 {
color: #222222;
color: #B80000;
border-bottom: 1px solid #B80000;
-webkit-text-decoration: none;
text-decoration: none;
Expand All @@ -13,14 +13,14 @@ exports[`InlineLink should render correctly 1`] = `
border-bottom: 1px solid #757575;
}

.c0:focus {
color: #B80000;
border-bottom: 2px solid #B80000;
}

.c0:focus,
.c0:hover {
color: #B80000;
background-color: #B80000;
border-bottom: 2px solid #B80000;
color: #FFFFFF;
margin: 0 -2px;
padding: 0 2px;
white-space: pre-wrap;
}

<a
Expand Down
16 changes: 8 additions & 8 deletions packages/components/psammead-inline-link/src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import styled from 'styled-components';
import { C_EBON, C_POSTBOX, C_CLOUD_DARK } from '@bbc/psammead-styles/colours';
import { C_POSTBOX, C_CLOUD_DARK, C_WHITE } from '@bbc/psammead-styles/colours';

const InlineLink = styled.a`
color: ${C_EBON};
color: ${C_POSTBOX};
border-bottom: 1px solid ${C_POSTBOX};
text-decoration: none;

Expand All @@ -11,14 +11,14 @@ const InlineLink = styled.a`
border-bottom: 1px solid ${C_CLOUD_DARK};
}

&:focus {
color: ${C_POSTBOX};
border-bottom: 2px solid ${C_POSTBOX};
}

&:focus,
&:hover {
color: ${C_POSTBOX};
background-color: ${C_POSTBOX};
border-bottom: 2px solid ${C_POSTBOX};
color: ${C_WHITE};
margin: 0 -2px;
padding: 0 2px;
white-space: pre-wrap;
}
`;

Expand Down
13 changes: 11 additions & 2 deletions packages/components/psammead-inline-link/src/index.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { Fragment } from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';
import { inputProvider } from '@bbc/psammead-storybook-helpers';
Expand All @@ -10,7 +10,16 @@ storiesOf('Components|InlineLink', module)
.add(
'default',
inputProvider([{ name: 'Link text' }], ([linkText]) => (
<InlineLink href="https://www.bbc.com/news">{linkText}</InlineLink>
<Fragment>
<InlineLink href="https://www.bbc.com/news">{linkText}</InlineLink>
<br />
<br />
Please note this component does not have its own typography styling
(font-size and line-height) as it is expected to be used within another
component such as paragraph or caption. For a more realistic storybook
example of this component see the Paragraph and Caption stories - this
should be removed in https://github.com/bbc/psammead/issues/733
</Fragment>
)),
{ notes, knobs: { escapeHTML: false } },
);