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

calypsoify: use css vars from calypso-color-schemes #12359

Closed
wants to merge 7 commits into from

Conversation

flootr
Copy link
Contributor

@flootr flootr commented May 14, 2019

related to #11478

Changes proposed in this Pull Request:

  • Add a PostCSS build step to calypsoify's gulp task for processing styles
  • Move SASS color variables over to use CSS custom properties (using @automattic/calypso-color-schemes

Is this a new feature or does it add/remove features to an existing part of Jetpack?

p9oQ9f-9o-p2

Testing instructions:

  • one part is to make sure each SASS color variable gets replaced with their correct CSS custom property replacement

test locally:

  • Start your local Jetpack dev environment and make sure Calypsoify is enabled (see my diff below)
diff --git a/modules/module-extras.php b/modules/module-extras.php
index 989512dcb..a3c976fc6 100644
--- a/modules/module-extras.php
+++ b/modules/module-extras.php
@@ -14,6 +14,7 @@
  */
 $tools = array(
        // Always loaded, but only registered if theme supports it.
+       'calypsoify/class.jetpack-calypsoify.php',
        'custom-post-types/comics.php',
        'custom-post-types/testimonial.php',
        'custom-post-types/nova.php',
@@ -40,7 +41,7 @@ $tools = array(

 // Some features are only available when connected to WordPress.com.
 $connected_tools = array(
-       'calypsoify/class.jetpack-calypsoify.php',
+       /* 'calypsoify/class.jetpack-calypsoify.php', */
        'plugin-search.php',
        'simple-payments/simple-payments.php',
        'woocommerce-analytics/wp-woocommerce-analytics.php',

@flootr flootr requested a review from a team May 14, 2019 09:04
@flootr flootr self-assigned this May 14, 2019
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello flootr! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D28164-code before merging this PR. Thank you!

@jetpackbot
Copy link

jetpackbot commented May 14, 2019

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: June 4, 2019.
Scheduled code freeze: May 28, 2019

Generated by 🚫 dangerJS against abaa2ca

postcss.config.js Outdated Show resolved Hide resolved
yarn.lock Outdated Show resolved Hide resolved
@@ -8493,7 +8512,7 @@ postcss-value-parser@^3.0.0, postcss-value-parser@^3.3.0, postcss-value-parser@^
version "3.3.1"
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281"

postcss-values-parser@^2.0.0:
postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1:
Copy link
Member

@simison simison May 15, 2019

Choose a reason for hiding this comment

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

All these double minor versions make me think if we should relax calypso-build semver just a little bit with ~ (instead of strict or ^). cc @ockham

Edit; tho I guess this specific one isn't coming from calypso-build since it has ^, but there were others like autoprefixer.

Copy link
Member

Choose a reason for hiding this comment

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

The way I read this line is that the ^ versions are working as expected, allowing compatible versions of the same package to dedupe to a single version. In this case ^2.0.0 and ^2.0.1 are both satisfied by 2.0.1. There's no negative impact to longer lines like this.

@flootr flootr force-pushed the update/calypsoify-stylings branch from 29fe51c to 4448854 Compare May 15, 2019 09:36
@flootr flootr force-pushed the update/calypsoify-stylings branch from 4135140 to 07c235a Compare May 20, 2019 06:33
@matticbot
Copy link
Contributor

flootr, Your synced wpcom patch D28164-code has been updated.

@Automattic Automattic deleted a comment from matticbot May 20, 2019
@Automattic Automattic deleted a comment from matticbot May 20, 2019
@Automattic Automattic deleted a comment from matticbot May 20, 2019
@flootr flootr changed the title (wip) calypsoify: enable custom properties from calypso-color-schemes (wip) calypsoify: use css vars from calypso-color-schemes May 20, 2019
@flootr flootr force-pushed the update/calypsoify-stylings branch from 2d8fc64 to 6adbad5 Compare May 20, 2019 11:50
@matticbot
Copy link
Contributor

flootr, Your synced wpcom patch D28164-code has been updated.

@sirreal
Copy link
Member

sirreal commented May 20, 2019

#12277 has landed so you'll likely want to rebase.

@flootr flootr force-pushed the update/calypsoify-stylings branch from 5d280b2 to 3450366 Compare May 20, 2019 12:29
@matticbot
Copy link
Contributor

flootr, Your synced wpcom patch D28164-code has been updated.

@flootr flootr changed the title (wip) calypsoify: use css vars from calypso-color-schemes calypsoify: use css vars from calypso-color-schemes May 23, 2019
@flootr flootr force-pushed the update/calypsoify-stylings branch from 3450366 to 08ff4c9 Compare May 23, 2019 08:08
@matticbot
Copy link
Contributor

flootr, Your synced wpcom patch D28164-code has been updated.

@flootr flootr force-pushed the update/calypsoify-stylings branch from 08ff4c9 to abaa2ca Compare May 27, 2019 10:18
@matticbot
Copy link
Contributor

flootr, Your synced wpcom patch D28164-code has been updated.

@flootr flootr requested a review from simison May 27, 2019 10:21
@flootr flootr added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] In Progress labels May 27, 2019
@flootr flootr requested a review from sirreal May 27, 2019 10:22
@flootr
Copy link
Contributor Author

flootr commented May 27, 2019

Rebased and updated testing instructions.

@jeherve jeherve added the [Status] Needs Design Review Design has been added. Needs a review! label May 27, 2019
Copy link
Member

@sirreal sirreal left a comment

Choose a reason for hiding this comment

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

Thanks for the work here!

I've left some comments and questions more on the build side of this.

I don't really know anything about the calypsoify module, so I'd like to delegate that part of the review to someone better equipped.

@@ -39,7 +40,7 @@ gulp.task( 'sass:calypsoify', function( done ) {
.src( './modules/calypsoify/*.scss' )
.pipe( sass( { outputStyle: 'compressed' } ).on( 'error', sass.logError ) )
.pipe( banner( '/* Do not modify this file directly. It is compiled SASS code. */\n' ) )
.pipe( autoprefixer() )
.pipe( postcss() )
Copy link
Member

Choose a reason for hiding this comment

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

Clarification/confirmation:

It looks like autoprefixer is replaced by postcss, but postcss uses the config added by this PR which is the config from calypso-build:

https://github.com/Automattic/wp-calypso/blob/fecfa1d72f1e244bbd9844488fb900581f1e274c/packages/calypso-build/postcss.config.js#L1-L9

And that config includes autoprefixer, so we still get it. Is that correct?

Seems there are many other gulp tasks using autoprefixer directly, so we still need to depend on the package directly.

@@ -181,6 +182,7 @@
"mockery": "2.1.0",
"nock": "10.0.6",
"node-wp-i18n": "1.2.3",
"postcss-custom-properties": "8.0.10",
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this dependency directly, or should we rely on calypso-build to pull it in?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we directly call on it, keep it. If it is only through calypso-build's provided functionality, I would say remove it.

Otherwise, we'd get in situations where we'd update postcss-custom-properties out of sync with calypso-build, just adding more bulk to the build process without reason.

@sixhours
Copy link
Contributor

sixhours commented Oct 1, 2019

👋 Hey all! What is the status on this? Fixing the Flows is looking at making some tweaks to the Calypsoify styles to bring them into better alignment with the current Calypso sidebar. The lack of color schemes support has come up as a potential flow to be fixed; folks who have a custom color scheme will see the default colors when viewing Calypsoify, making for a rough transition.

I'm posting a data request to find out what kind of impact we're looking at, but also curious if this is close to being finished. It's possible we could help bring it to the finish line if need be. :)

@flootr
Copy link
Contributor Author

flootr commented Oct 7, 2019

@sixhours I'm not currently working on this and there seem to be some conflicts now. From what I remember though this was in a working state back then. Feel free to jump in if this is something which could be valuable to you (and ping me in case anything is unclear).

@eeeeevon13
Copy link
Contributor

eeeeevon13 commented Jun 8, 2020

@sixhours is this still an open issue? clearing out some "needs design review" items for Hack week. If you still need design review can you re-apply the "needs design" tag? Thanks!

@eeeeevon13 eeeeevon13 removed the [Status] Needs Design Review Design has been added. Needs a review! label Jun 9, 2020
@jeherve
Copy link
Member

jeherve commented Mar 2, 2022

I'll close this PR for now because of the lack of activity on this. We can always reopen in the future if needed, but it will need a rebase, so it may be easier to start a new PR at this point.

@jeherve jeherve closed this Mar 2, 2022
@github-actions github-actions bot removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants