Skip to content

Commit

Permalink
Merge pull request #1245 from guardian/skb/add-heading-size-config
Browse files Browse the repository at this point in the history
Adds heading size to design model
  • Loading branch information
sookburt authored Nov 12, 2024
2 parents 133c6f9 + bc8383f commit 14212f9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-ties-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@guardian/support-dotcom-components': minor
---

Adds a new optional field for fonts to the model for Configurable Design banners
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See [architecture](docs/architecture.md) for details.
This project uses [nvm](https://github.com/nvm-sh/nvm). You should run `nvm use` in your terminal before running any of the following commands. To set up, first run

```bash
pnpm
pnpm install
```

This will install all the project dependencies.
Expand Down Expand Up @@ -77,7 +77,7 @@ The `/src` directory contains 3 subdirectories:

Releasing to NPM is handled with [changesets] and is performed by CI.

On your feature branch, before merging, run `pnpm dotcom changeset` from the root of the project. This will
On your feature branch, before merging, run `pnpm changeset` from the root of the project. This will
interactively ask you what kind of change this is (major, minor, patch) and
allow you to describe the change. Commit the generated changeset file to git and
push to your branch.
Expand Down
5 changes: 5 additions & 0 deletions src/server/factories/bannerDesign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export default Factory.define<BannerDesignFromTool>(() => ({
'https://i.guim.co.uk/img/media/6c933a058d1ce37a5ad17f79895906150812dfee/0_0_1768_1420/500.png?width=500&quality=75&s=9277532ddf184a308e14218e3576543b',
altText: 'Example alt text',
},
fonts: {
heading: {
size: 'medium',
},
},
colours: {
basic: {
background: stringToHexColour('F1F8FC'),
Expand Down
9 changes: 9 additions & 0 deletions src/shared/types/props/design.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,18 @@ interface ChoiceCardsDesign {
}
type Visual = BannerDesignImage | ChoiceCardsDesign;

type FontSize = 'small' | 'medium' | 'large';

interface Font {
size: FontSize;
}

export interface ConfigurableDesign {
visual?: Visual;
headerImage?: BannerDesignHeaderImage;
fonts?: {
heading: Font;
};
colours: {
basic: {
background: HexColour;
Expand Down

0 comments on commit 14212f9

Please sign in to comment.