-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add @automattic/onboarding package to standardize stylesheets & reuse components. #44077
Conversation
… Renamed sass folder to styles. Added variables file.
…/onboarding package.
…automattic/typography & @automattic/onboarding.
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~12 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
Caution: This PR affects files in the FSE Plugin on WordPress.com D46237-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing in the FSE Plugin for more info: PCYsg-ly5-p2 |
$onboarding-header-height: $header-height; | ||
$onboarding-footer-height: $header-height; |
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.
Take note that this was originally hardcoded to 64px
. This is now inherited directly from core WP which has a value of 60px
. This ensures header height consistency from gutenboarding to block editor.
@@ -1,5 +1,5 @@ | |||
@import '../styles/placeholder.scss'; // Contains the placeholder mixin | |||
@import '../styles/mixins'; | |||
@import '~@automattic/calypso-color-schemes'; |
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.
Need to beware not to import this multiple times as this creates styling duplication.
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.
Hm! Wouldn't it now be included multiple times by importing this to Gutenboarding, which also includes this package? 🤔
Should it be declared it as peerDependencies
?
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.
Wouldn't it now be included multiple times by importing this to Gutenboarding, which also includes this package?
I think this is happening right now. If you look at entry-gutenboarding.css
file the :root
selector where all the color declarations are repeated at least twice. Need to investigate how this is happening but not something to fix in this PR.
Should it be declared it as
peerDependencies
?
Not sure if sass-loader
actually reads these things.
@import '../base-styles.scss'; | ||
@import '../mixins.scss'; | ||
@import '../variables.scss'; | ||
@import '~@wordpress/base-styles/breakpoints'; | ||
@import '~@wordpress/base-styles/mixins'; | ||
@import '~@automattic/typography/styles/variables'; |
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.
This is done to import only the specific files that has the specific variables & mixins needed instead of blindly importing everything. You'll see this in a few other files as well.
"main": "sass/fonts.scss", | ||
"main": "styles/fonts.scss", |
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.
The sass
folder has been renamed to styles
folder for consistency.
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.
a8ffdbc
to
26021c5
Compare
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.
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.
@yansern 👋 Hello! The last run wp-desktop-source
job was failinging with the error:
@automattic/onboarding: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run prepare exited 2 in '@automattic/onboarding'
lerna WARN complete Waiting for 7 child processes to exit. CTRL-C to exit immediately.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
The wp-desktop
review would have automatically been dismissed once the job was re-ran and passed (looks like it was dismissed it manually, so it's unclear what the CI status was).
However for some reason this job is missing from the latest SHA for this PR - not sure why. Also - only 8 checks were performed (there's typically around 22-23 CI jobs that are ran against any given Calypso PR).
Can we make sure that the full suite of CI tests is reflected prior to getting this landed?
There seems to be this error logged when Install dependencies step fail for
Not sure why this would happen. Re-adding Needs Review tag in case this helps. |
Perhaps a rebase might help kick-start things as well? If it helps, you can now debug the wp-desktop build wholly from within Calypso by running |
It looks like this file was renamed as part of this PR? 🤔 |
Yes, it was extracted from |
@razvanpapadopol The reason CI isn't running on this branch is that the root Calypso CI job
So this error isn't specific to the You can verify the Circle CI activity for this branch PR at this link. |
"classnames": "^2.2.6" | ||
}, | ||
"devDependencies": { | ||
"@wordpress/base-styles": "^1.8.0", |
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.
Needs @automattic/typography
too?
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.
Good catch! Added to onboarding & plans-grid package. d4633a6
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.
Shouldn't this be added also to FSE deps? I see @wordpress/base-styles there
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.
Done.
Sorry, that was me. Wasn't sure why the desktop CI was relevant but later I saw that all tests were passing I dismissed it. Good to know that if it was really ALL tests were passing then it will be automatically dismissed.
Yup all good now with 67014. |
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.
Great work building a solid foundation for the reusable onboarding components! 💯
Changes proposed in this Pull Request
Created
@automattic/onboarding
package.The intention of this package is to offer onboarding stylesheets & components that can be reused across Calypso, FSE & WP-Admin. Currently it has SCSS variables & mixins,
<Title>
and<Subtitle>
component taken out from Gutenboarding.Expanded
@automattic/typography
with font family & font size variables.This is taken out from
client/assets/stylesheets/shared/_typography.scss
file so it can be used outside of Calypso.Clean up all the SCSS variables & mixins,
<Title>
&<Subtitle>
duplication across the calypso codebase (within the scope of onboarding & typography). This includes:gutenboarding
to use@automattic/onboarding
.@automattic/domain-picker
to use@automattic/onboarding
.@automattic/plans-grid
to use@automattic/onboarding
.magic-login
,wp-login
&signup
stylesheet to use mixins from@automattic/onboarding
.wpcom-block-editor-nux
plugin to import fonts & mixins from@automattic/typography
&@automattic/onboarding
.There are a lot of files modified in this PR. However, they do very simple changes. To review this PR, it is easier to review by commits, as commits are grouped thematically. Most work revolves around importing, renaming variables and removing duplicated codes.
Usage Examples
For using onboarding/typography variables & mixins:
For using
<Title>
&<SubTitle>
components:Testing instructions
yarn
to rebuild all packages.yarn start
to boot up Calypso locally./new
, everything should look the same.Note: Testing launch flow on FSE is on this PR #44087 which is based off this PR.
Fixes part of #43750