Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to theme prop proposal #1085

Merged

Conversation

sndrs
Copy link
Member

@sndrs sndrs commented Jan 16, 2024

What are you changing?

  • create one choiceCardTheme type
  • renames some of the theme munging stuff
  • requires a theme to be passed the styles functions (rather than defaulting - let's default in one place)
  • adds types the to story to clean up the red squiggles

@sndrs sndrs requested a review from a team as a code owner January 16, 2024 15:07
Copy link

changeset-bot bot commented Jan 16, 2024

⚠️ No Changeset found

Latest commit: a59cbe7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the 📦 npm Affects a @guardian package on NPM label Jan 16, 2024
Comment on lines +73 to +77
CustomTheme.args = {
theme: {
backgroundUnselected: 'black',
backgroundSelected: 'hotpink',
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the theme: choiceCardDark better if we consider this as part of the documentation for this component. It is the "recommended" way of theming

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i think it would be if we had a dark theme for this component. in that case we'd want to explicit provide a story for that (and any other built-in themes).

the reason i removed it here is because we don't (yet?) have that, and so hopefully this makes clear it's a made up example of one way of using the prop, rather than implying there was a dark theme you can use

Copy link
Contributor

@oliverabrahams oliverabrahams Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Happy to go with that, we could change the colours to come from the palette because that may be more how we want the prop used. I am happy to do that once this is merged tho.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i think we do want that, but part of me felt that because right now you can do the 'wrong' thing, we should have a story that does that, then have it break when we fix it. maybe that's the wrong approach.

but maybe we shoudl fix the types in foundations so you can't?

Copy link
Contributor

@oliverabrahams oliverabrahams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sndrs sndrs merged commit f492aa2 into oa/test-colour-variables-source Jan 16, 2024
8 checks passed
@sndrs sndrs deleted the sndrs/test-colour-variables-source branch January 16, 2024 17:17
sndrs added a commit that referenced this pull request Jan 16, 2024
Co-authored-by: Oliver Abrahams <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 npm Affects a @guardian package on NPM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants