Skip to content

Commit

Permalink
[CCUBE-1597][RL] amend styles to match design mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
qroll committed Oct 27, 2024
1 parent 0aabee4 commit 7322a5f
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 222 deletions.
6 changes: 2 additions & 4 deletions src/alert/alert.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export const Wrapper = styled.div<StyleProps>`
color: ${Colour.text};
${(props) => {
if (props.$sizeType === "small") {
return applyHtmlContentStyle({ textSize: "body-md" });
return applyHtmlContentStyle({ textSize: "body-sm" });
}
return applyHtmlContentStyle({ textSize: "body-sm" });
return applyHtmlContentStyle({ textSize: "body-md" });
}}
`;

Expand Down Expand Up @@ -138,13 +138,11 @@ export const ActionLinkText = styled(Typography.LinkSM)<StyleProps>`
display: flex;
align-items: center;
align-self: flex-start;
color: ${Colour.hyperlink};
svg {
height: 1rem;
width: 1rem;
margin-left: 0.25rem;
color: ${Colour.hyperlink};
}
`;

Expand Down
10 changes: 4 additions & 6 deletions src/file-upload/file-upload.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@ export const TextContainer = styled.div`
display: flex;
flex-direction: column;
margin-bottom: 2rem;
gap: 0.5rem;
`;

export const Title = styled(Typography.HeaderXS)`
margin-bottom: 0.5rem;
`;
``;
export const Title = styled(Typography.BodyBL)``;

export const TitleContainer = styled.div`
color: ${Colour.text};
${applyHtmlContentStyle({ textSize: "body-baseline" })}
`;

export const Description = styled(Typography.BodyMD)`
margin-bottom: 0;
color: ${Colour["text-subtler"]};
`;

Expand Down Expand Up @@ -56,9 +53,10 @@ export const UploadButton = styled(Button.Small)`
width: 100%;
}
`;

export const UploadButtonLabel = styled.label`
${Font["body-md-semibold"]}
color: ${Colour["text-primary"]};
color: ${Colour["text-subtler"]};
margin-top: 0.5rem;
width: 10rem;
text-align: center;
Expand Down
4 changes: 2 additions & 2 deletions src/file-upload/file-upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const FileUpload = ({
}

if (typeof title === "string") {
return <Title weight="regular">{title}</Title>;
return <Title>{title}</Title>;
}

return <TitleContainer>{title}</TitleContainer>;
Expand All @@ -113,7 +113,7 @@ export const FileUpload = ({
}

if (typeof description === "string") {
return <Description weight="regular">{description}</Description>;
return <Description>{description}</Description>;
}

return <DescriptionContainer>{description}</DescriptionContainer>;
Expand Down
33 changes: 6 additions & 27 deletions src/form/form-label.style.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,18 @@
import styled from "styled-components";
import { Colour, Font } from "../theme";
import { applyHtmlContentStyle } from "../shared/html-content/html-content";
import { Colour, FontSpec } from "../theme";
import { Typography } from "../typography";

// =============================================================================
// STYLING
// =============================================================================
export const Label = styled.label`
${Font["header-xs-semibold"]}
color: ${Colour["text-subtle"]};
margin-bottom: 0.5rem;
display: inline-block;
a,
span,
p {
${Font["header-xs-semibold"]}
}
a {
color: ${Colour.hyperlink};
text-decoration: none;
:hover,
:active,
:focus {
color: ${Colour["hyperlink-hover"]};
svg {
color: ${Colour["hyperlink-hover"]};
}
}
}
${applyHtmlContentStyle({ textSize: "body-md" })}
font-weight: ${FontSpec["weight-semibold"]};
`;

// check input
Expand All @@ -41,9 +23,6 @@ export const ErrorMessage = styled(Typography.BodySM)`
outline: none;
`;

export const Subtitle = styled(Typography.BodyMD)`
&& {
color: ${Colour.text};
${Font["body-sm-regular"]}
}
export const Subtitle = styled(Typography.BodySM)`
color: ${Colour["text-subtler"]};
`;
3 changes: 1 addition & 2 deletions src/modal/modal-box.styles.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import styled from "styled-components";
import { ClickableIcon } from "../shared/clickable-icon";
import { MediaQuery } from "../theme";
import { Colour } from "../theme";
import { Colour, MediaQuery } from "../theme";

export const Box = styled.div`
position: relative;
Expand Down
1 change: 1 addition & 0 deletions src/modal/modal-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const ModalBox = ({
onClick={onClose}
data-testid="close-button"
focusHighlight={false}
focusOutline="browser"
>
<CrossIcon />
</CloseButton>
Expand Down
15 changes: 7 additions & 8 deletions src/shared/html-content/html-content.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css } from "styled-components";
import { FontFamily } from "../../spec/text-spec/font-spec";
import { Colour, Font, FontSpec } from "../../theme";
import { TypographySizeType } from "../../theme/font/types";
import { Colour, Font } from "../../theme";

export interface HtmlContentStyleOptions {
textSize?: TypographySizeType | undefined;
Expand All @@ -15,8 +14,8 @@ export const applyHtmlContentStyle = (options?: HtmlContentStyleOptions) => {
${textSize && Font[`${textSize}-regular`]}
strong {
font-family: ${FontFamily.OpenSans.Semibold};
${textSize && Font[`${textSize}-semibold`]}
font-weight: ${FontSpec["weight-semibold"]};
${textSize && Font[`${textSize}-semibold`]};
}
p {
Expand All @@ -25,17 +24,17 @@ export const applyHtmlContentStyle = (options?: HtmlContentStyleOptions) => {
// Link styling
a {
font-family: ${FontFamily.OpenSans.Semibold};
font-weight: ${FontSpec["weight-semibold"]};
${textSize && Font[`${textSize}-semibold`]}
color: ${Colour.hyperlink};
text-decoration: none;
svg {
color: ${Colour["icon-primary"]};
height: 1rem;
width: 1rem;
height: 1lh;
width: 1em;
margin-left: 0.4rem;
vertical-align: baseline;
vertical-align: middle;
}
:hover,
Expand Down
24 changes: 18 additions & 6 deletions src/shared/toggle-icon/toggle-icon.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Colour } from "../../theme";

interface StyleProps {
$active?: boolean;
disabled?: boolean;
$disabled?: boolean;
}

// =============================================================================
Expand All @@ -18,17 +18,29 @@ export const Wrapper = styled.div<StyleProps>`
svg {
height: 100%;
width: 100%;
}
${(props) => {
if (props.$active && !props.disabled) {
${(props) => {
if (props.$disabled) {
if (props.$active) {
return css`
color: ${Colour["icon-primary"]};
color: ${Colour["icon-selected-disabled"]};
`;
} else {
return css`
color: ${Colour["icon-disabled-subtle"]};
`;
}
}};
}
}
if (props.$active) {
return css`
color: ${Colour["icon-selected"]};
`;
}
return css`
color: ${Colour["icon-subtle"]};
`;
}};
`;
2 changes: 1 addition & 1 deletion src/shared/toggle-icon/toggle-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const ToggleIcon = ({
}

return (
<Wrapper className={className} $active={active} disabled={disabled}>
<Wrapper className={className} $active={active} $disabled={disabled}>
{component}
</Wrapper>
);
Expand Down
2 changes: 1 addition & 1 deletion src/theme/colour-semantic/specs/lifesg-semantic-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const LifeSGColourSet: SemanticColourSet = {
"border-selected": getPrimitiveColour("primary-50"),
"border-selected-subtle": getPrimitiveColour("primary-70"),
"border-selected-subtlest": getPrimitiveColour("primary-90"),
"border-selected-hover": getPrimitiveColour("primary-90"),
"border-selected-hover": getPrimitiveColour("primary-40"),

"border-focus": getPrimitiveColour("primary-60"),
"border-focus-strong": getPrimitiveColour("primary-50"),
Expand Down
Loading

0 comments on commit 7322a5f

Please sign in to comment.