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

Move TabNav styles to PVC #1627

Closed
wants to merge 15 commits into from
Closed

Move TabNav styles to PVC #1627

wants to merge 15 commits into from

Conversation

mxriverlynn
Copy link
Contributor

⚠️ WIP ⚠️

Description

Describe your changes here.

Closes # (type the issue number after # if applicable; otherwise remove this line)

Integration

Does this change require any updates to code in production?

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews

@changeset-bot
Copy link

changeset-bot bot commented Nov 21, 2022

🦋 Changeset detected

Latest commit: 404d165

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mxriverlynn mxriverlynn temporarily deployed to review-pr-1627 November 21, 2022 15:11 Inactive
@github-actions github-actions bot added the css Pull requests that update CSS code label Nov 21, 2022
@mxriverlynn mxriverlynn temporarily deployed to review-pr-1627 November 21, 2022 18:32 Inactive
@primer primer deleted a comment from github-actions bot Nov 21, 2022
@mxriverlynn mxriverlynn temporarily deployed to github-pages November 21, 2022 20:15 Inactive
@mxriverlynn mxriverlynn changed the title Move tabnav css to PVC Move TabNav styles to PVC Nov 21, 2022
@@ -0,0 +1,61 @@
:root {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @mxriverlynn! I'm not sure we want to move SCSS variables to PVC. I think they will mostly be reserved for utility CSS at this point, and the CSS that we move over from PCSS should use the new set of design tokens that are already being used in tab_nav. If there's an issue or discussion you can point me towards that is suggesting we should move all our existing variables to PVC, please let me know!

Copy link
Contributor

@simurai simurai Nov 22, 2022

Choose a reason for hiding this comment

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

Migrating the SCSS variables to the CSS variables from Primitives is definitely the hardest part. 😆

There isn't always a clear 1:1 replacement and it depends on the use case. Especially for margin/padding. I started a .scss to .pcss migration guide. It's not really complete and I've just been adding to it while going along. Also might not be 100% accurate. Let me know in case something is unclear.

@simurai
Copy link
Contributor

simurai commented Nov 22, 2022

Sorry.. 😩 The TabNav styles already got moved as part of #1626.

To avoid moving the same thing twice, should we add our @handle next to the task in https://github.com/github/primer/issues/1342 before we start? I added all remaining PCSS imports for Lookbook. Only the hard ones are left. 😆

The ones with ??? at the end I'm not even sure if we should move those. Maybe we need to have a discussion if dotcom should completely drop PCSS dependency or keep it for things like color and base styles.

Screen Shot 2022-11-22 at 9 17 02

@@ -77,6 +77,7 @@
"postcss-cli": "^10.0.0",
"postcss-import": "^14.1.0",
"postcss-mixins": "^9.0.3",
"postcss-nested": "^6.0.0",
Copy link
Contributor

@simurai simurai Nov 22, 2022

Choose a reason for hiding this comment

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

So far we haven been adding a & anywhere a nested class is used:

  .some-class {
-   .octicon {
+   & .octicon {
      ...
    }
  }

but I assume postcss-nested would allow us to keep using the "SCSS nesting" without the & ? @jonrohan also mentioned that it might will become a CSS standard. So using postcss-nested might be fine? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

We're trying to write closer to CSS spec. That said they are talking about changing the specification for nesting and there's an experimental plugin we could use to try it. https://twitter.com/css_tools_/status/1587392707206561792?s=46&t=OsB8hQIe4u2xhsK3WD3iYw

https://twitter.com/css_tools_/status/1587392697857413120?s=46&t=OsB8hQIe4u2xhsK3WD3iYw

@mxriverlynn
Copy link
Contributor Author

closed as duplicate

@jonrohan jonrohan deleted the mxriverlynn/tabnav-css branch February 13, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css Pull requests that update CSS code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants