-
Notifications
You must be signed in to change notification settings - Fork 14
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: Adds new tokens to Incentives #49
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Preview is readyThis pull request generated a Preview👀 Preview: https://preview-49--gatsby.preview.vtex.app |
Lighthouse ReportsHere are the Lighthouse reports of this Pull Request📝 Based on commit 68266c0
|
…s/gatsby.store into feat/theming-incentive
Try to improve the page LCP by boosting the priority for the main image. By setting `fetchpriority` to `high` we can hint the browser to give a higher priority to our LCP images. Use `psi-test` to compare before and after. Page result - https://sfj-7de89f9--nextjs.preview.vtex.app/ | Metric | Mean | Standard deviation | Confidence Interval (95%) | |--------|--------|--------|--------| | Largest Contentful Paint (LCP) | 2221.49 | 152192.99 | [-64480.03, 68923.01] | | Performance score | 0.839 | 0.000979 | [0.838571, 0.839429] | Page result - https://sfj-f5d2958--nextjs.preview.vtex.app/ | Metric | Mean | Standard deviation | Confidence Interval (95%) | |--------|--------|--------|--------| | Largest Contentful Paint (LCP) | 1475.76 | 42521.48 | [-17160.10, 20111.61] | | Performance score | 0.879 | 0.000619 | [0.878729, 0.879271] | Page result - https://sfj-7de89f9--nextjs.preview.vtex.app/office | Metric | Mean | Standard deviation | Confidence Interval (95%) | |--------|--------|--------|--------| | Largest Contentful Paint (LCP) | 1681.58 | 120980.33 | [-51340.39, 54703.55] | | Performance score | 0.899 | 0.000625 | [0.899226, 0.899774] | Page result - https://sfj-f5d2958--nextjs.preview.vtex.app/office | Metric | Mean | Standard deviation | Confidence Interval (95%) | |--------|--------|--------|--------| | Largest Contentful Paint (LCP) | 1422.32 | 55090.06 | [-22721.96, 25566.61] | | Performance score | 0.903 | 0.000169 | [0.902426, 0.902574] | Page result - https://sfj-7de89f9--nextjs.preview.vtex.app/apple-magic-mouse-99988212/p | Metric | Mean | Standard deviation | Confidence Interval (95%) | |--------|--------|--------|--------| | Largest Contentful Paint (LCP) | 2855.38 | 65371.98 | [-25795.15, 31505.92] | | Performance score | 0.736 | 0.005824 | [0.733448, 0.738552] | Page result - https://sfj-f5d2958--nextjs.preview.vtex.app/apple-magic-mouse-99988212/p | Metric | Mean | Standard deviation | Confidence Interval (95%) | |--------|--------|--------|--------| | Largest Contentful Paint (LCP) | 2294.23 | 84993.06 | [-34955.62, 39544.08] | | Performance score | 0.842 | 0.003156 | [0.840617, 0.843383] | - [[web.dev] Optimizing resource loading with Priority Hints](https://web.dev/priority-hints/) - [[web.dev] Optimize Largest Contentful Paint](https://web.dev/optimize-lcp/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! 👏
--fs-incentives-title-line-height : 1.42; | ||
|
||
// Description | ||
--fs-incentives-description-size : var(--fs-incentives-title-size); | ||
--fs-incentives-description-line-height : 1.14; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@renatamottam and @hellofanny, are you planning to have tokens for the line-height? It would be nice to standardize some values in tokens so they don't feel arbitrary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. We have associate line-height for titles on Typography, not sure if this works for local values. But might be a good idea.
…s/gatsby.store into feat/theming-incentive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 🤩 🤩 🤩 I noticed that Props
section title was missing on the doc, so I've left it as a suggestion.
Co-authored-by: Fanny Chien <fannychienn@gmail.com>
What's the purpose of this pull request?
This PR intends to add new tokens to the
Incentives
component using the Theming Structure.Corresponding PR in Nextjs store: vtex-sites/nextjs.store#56
How does it work?
This PR uses local variables to parameterize the
Incentives
properties, then connects these scoped tokens to the global ones.It also adds a new variant to
Incentives
, which can be called like that:< Incentives incentives={IncentivesMock} variant="vertical" />
New global tokens:
None.
New local tokens for
Incentives
:Default properties:
--fs-incentives-bkg-color
var(--fs-color-primary-bkg-light)
--fs-incentives-gap
var(--fs-spacing-4)
--fs-incentives-padding-top
var(--fs-incentives-gap)
--fs-incentives-padding-bottom
var(--fs-incentives-gap)
--fs-incentives-border-color
var(--fs-border-color-light)
--fs-incentives-border-width
var(--fs-border-width)
Nested Elements:
Title
--fs-incentives-title-size
var(--fs-text-size-1)
--fs-incentives-title-weight
var(--fs-text-weight-bold)
--fs-incentives-title-line-height
1.42
--fs-incentives-title-color
var(--fs-color-neutral-7)
Description
--fs-incentives-description-size
var(--fs-incentives-title-size)
--fs-incentives-description-line-height
1.14
--fs-incentives-description-color
var(--fs-incentives-title-color)
Icon
--fs-incentives-icon-color
var(--fs-incentives-title-color)
How to test it?
The
Incentives
component should look just as it was before these changes. You may see it either on Gatsby store and on the Storybook.Checklist
You may erase this after checking them all ;)
Added an entry in the
CHANGELOG.md
at the beginning of its due section. The latest version should comes first.Added the PR number with the PR link at the entry in the
CHANGELOG.md
. E.g., New items in thepull_request_template.md
(#12)PR description
Updated the Storybook - if applicable.
Added a label according to the PR goal -
Breaking change
,Enhancement
,Bug
orChore
.Added the component, hook, or pathname in-between backticks (``) - If applicable. E.g.,
ComponentName
component.Identified the function or parameter in the PR - If applicable. E.g.,
useWindowDimensions
hook.For documentation changes, ping @carolinamenezes or @Mariana-Caetano to review and update the changes.