Skip to content

Commit

Permalink
Merge pull request #11631 from bbc/WSTEAM1-1020-adds-default-styling-…
Browse files Browse the repository at this point in the history
…text-link-uploader

WSTEAM1-1020 - Adds default styling for P and A elements on the Uploader form
  • Loading branch information
HarveyPeachey committed May 20, 2024
2 parents 26f5b4e + 5c3f14b commit edaf647
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
33 changes: 16 additions & 17 deletions src/app/components/InlineLink/index.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ import { css, Theme } from '@emotion/react';

import pixelsToRem from '../../utilities/pixelsToRem';

const styles = {
self: ({ palette }: Theme) =>
css({
color: palette.EBON,
borderBottom: `${pixelsToRem(1)}rem solid ${palette.POSTBOX}`,
textDecoration: 'none',
'&:visited': {
color: palette.METAL,
borderBottom: `${pixelsToRem(1)}rem solid ${palette.METAL}`,
},
'&:focus, &:hover': {
borderBottom: `${pixelsToRem(2)}rem solid ${palette.POSTBOX}`,
color: palette.POSTBOX,
},
}),
};
export const getInlineLinkStyles = (palette: Theme['palette']) => ({
color: palette.EBON,
borderBottom: `${pixelsToRem(1)}rem solid ${palette.POSTBOX}`,
textDecoration: 'none',
'&:visited': {
color: palette.METAL,
borderBottom: `${pixelsToRem(1)}rem solid ${palette.METAL}`,
},
'&:focus, &:hover': {
borderBottom: `${pixelsToRem(2)}rem solid ${palette.POSTBOX}`,
color: palette.POSTBOX,
},
});

export default styles;
export const styles = {
self: ({ palette }: Theme) => css(getInlineLinkStyles(palette)),
};
2 changes: 1 addition & 1 deletion src/app/components/InlineLink/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Url from 'url-parse';

import { FontVariant, GelFontSize } from '../../models/types/theming';
import { ServiceContext } from '../../contexts/ServiceContext';
import styles from './index.styles';
import { styles } from './index.styles';

interface Props extends HTMLAttributes<HTMLElement> {
className?: string;
Expand Down
8 changes: 7 additions & 1 deletion ws-nextjs-app/pages/[service]/send/[id]/Form/styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pixelsToRem from '#app/utilities/pixelsToRem';
import { Theme, css } from '@emotion/react';
import { getInlineLinkStyles } from '#app/components/InlineLink/index.styles';

export default {
submissionError: () =>
Expand Down Expand Up @@ -28,12 +29,17 @@ export default {
paddingBottom: `${spacings.FULL}rem`,
marginBottom: `${spacings.TRIPLE}rem`,
},
p: { color: palette.BLACK },
a: getInlineLinkStyles(palette),
}),
privacyNotice: ({ fontVariants, fontSizes }: Theme) =>
privacyNotice: ({ palette, fontVariants, fontSizes }: Theme) =>
css({
...fontVariants.sansRegular,
...fontSizes.brevier,
p: { color: palette.BLACK },
a: getInlineLinkStyles(palette),
}),

privacyHeading: ({ fontVariants, fontSizes }: Theme) =>
css({
...fontVariants.sansBold,
Expand Down

0 comments on commit edaf647

Please sign in to comment.