Skip to content

Conversation

@jesstelford
Copy link
Contributor

@jesstelford jesstelford commented Oct 6, 2023

Depends on #10489

The SASS functions are starting to get more complicated, yet are untested. Given their foundational use within Polaris, @gwyneplaine & I figured it was time we added some unit tests.

This PR sets up SASS True for running unit tests on SASS within Jest, and includes some sample tests to begin with.

Screenshot 2023-10-06 at 6 58 31 pm

@jesstelford jesstelford force-pushed the responsive-props-tests branch from c88cfbb to 6c8c381 Compare October 6, 2023 08:04
@sam-b-rose
Copy link
Member

Definitely in favor of making our tests more robust to support and validate advanced styling functions. However, I think the direction is to remove SCSS from web. Polaris will likely follow

Is there a way we could support features and tests like this using PostCSS or native CSS? Or perhaps we adopt a different strategy for handling responsive props down the road. This example is not a 1:1 "replacement", but maybe we go back to first-principles on this and approach it from a different angle.

@jesstelford
Copy link
Contributor Author

I think the direction is to remove SCSS from web. Polaris will likely follow

Yep, am keeping that at the front my mind while I work on these 👍 I outlined here a couple paths forward after this work is merged:

Depends on what we're aiming for;

  1. If we're going to PostCSS, then most of the functionality can be moved into postcss-mixins by the looks of it.
  2. If we're going to CSS-in-JS, then the functionality can be converted to JS fairly easily.
  3. If we're going to pure CSS without PostCSS plugins or CSS-in-JS then we could either fallback to creating and injecting stylesheets, or reassess the overall strategy.

@jesstelford jesstelford force-pushed the responsive-props-tests branch from 6c8c381 to 2c79cc4 Compare October 7, 2023 01:32
@jesstelford jesstelford force-pushed the grid-responsive-props-10484 branch 2 times, most recently from 89610fb to d690c14 Compare October 7, 2023 08:37
@jesstelford jesstelford force-pushed the responsive-props-tests branch from 2c79cc4 to 62d05d7 Compare October 7, 2023 08:39
@jesstelford jesstelford force-pushed the grid-responsive-props-10484 branch from d690c14 to 8eac426 Compare October 7, 2023 21:53
@jesstelford jesstelford force-pushed the responsive-props-tests branch 2 times, most recently from a1b37f9 to 2e7d40f Compare October 7, 2023 22:04
@jesstelford jesstelford force-pushed the grid-responsive-props-10484 branch from 8eac426 to c1edb9f Compare October 19, 2023 20:29
@jesstelford jesstelford force-pushed the responsive-props-tests branch from 2e7d40f to 1816427 Compare October 19, 2023 20:30
@jesstelford
Copy link
Contributor Author

Superseded by #11252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants