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

feat(Header): small version, allow removing vertical padding #822

Merged
merged 5 commits into from
Jul 20, 2023

Conversation

atabel
Copy link
Collaborator

@atabel atabel commented Jul 18, 2023

Jira with specs: https://jira.tid.es/browse/WEB-1469

  • Added a small prop in Header to reduce the title/description font size
  • Added a noPaddingY prop to HeaderLayout to remove the vertical padding (required by Novum CMS layout, which establishes its own paddings)
  • Added support for responsive space in Stack and Box components:
<Stack space={{mobile: 8, tablet: 16, desktop: 24}}>

<Box paddingY={{mobile: 16, desktop: 24}}>

When using the responsive notation (object), setting both mobile and desktop is mandatory. tablet is optional, and will use mobile value by default when not specified.
This will allow us to reduce the use of useScreenSize() hook, which is problematic with SSR.
In this PR I've applied this to header components, but we should do the same with the rest of components in Mística too. It's still pending to apply the same approach in Inline component

@github-actions
Copy link

github-actions bot commented Jul 18, 2023

Size stats

master this branch diff
Total JS 9.36 MB 9.37 MB +13.6 kB
JS without icons 874 kB 888 kB +13.6 kB
Lib overhead 122 kB 127 kB +4.95 kB
Lib overhead (gzip) 31.8 kB 32.8 kB +976 B

@github-actions
Copy link

github-actions bot commented Jul 18, 2023

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@github-actions
Copy link

github-actions bot commented Jul 18, 2023

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-lefybsi5a-tuentisre.vercel.app

Built with commit 274be5e.
This pull request is being automatically deployed with vercel-action

@@ -19,6 +20,26 @@ const colorProperties = defineProperties({

const sizes = [0, 2, 4, 8, 12, 16, 20, 24, 32, 40, 48, 56, 64, 72, 80] as const;

const responsiveProperties = defineProperties({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this allows us using responsive padding sprinkles:

sprinkles({padding: {mobile: 8, desktop: 16}})

src/header.tsx Show resolved Hide resolved
<ResponsiveLayout isInverse={isInverse}>
<ResponsiveLayout
isInverse={isInverse}
dataAttributes={{'component-name': 'MainSectionHeaderLayout', ...dataAttributes}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you can use getPrefixedDataAttributes here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, that would be wrong. That's already done internally in ResponsiveLayout

@atabel atabel requested a review from yceballost July 19, 2023 11:04
@atabel atabel changed the title WEB-1469 feat(Header): small version, allow removing vertical padding feat(Header): small version, allow removing vertical padding Jul 20, 2023
@atabel atabel added this pull request to the merge queue Jul 20, 2023
Merged via the queue into master with commit 448387e Jul 20, 2023
10 checks passed
@atabel atabel deleted the atoledano-header-evolution branch July 20, 2023 08:08
tuentisre pushed a commit that referenced this pull request Jul 20, 2023
# [14.18.0](v14.17.1...v14.18.0) (2023-07-20)

### Bug Fixes

* **DisplayMediaCard, PosterCard:** add label to video control ([#823](#823)) ([dc765ef](dc765ef))
* **row:** add missing dataAttributes ([#815](#815)) ([47e7cab](47e7cab))

### Features

* **AdvancedDataCard:** new community component ([#780](#780)) ([2803b9c](2803b9c))
* **Blocks:** new Mistica Community Components ([#770](#770)) ([8fc368a](8fc368a))
* **Header:** small version, allow removing vertical padding ([#822](#822)) ([448387e](448387e))
* **Nakedcard:** new component ([#819](#819)) ([688bb8e](688bb8e))
@tuentisre
Copy link
Collaborator

🎉 This PR is included in version 14.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants