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

Disable is() selector #1722

Merged
merged 4 commits into from
Dec 21, 2022
Merged

Disable is() selector #1722

merged 4 commits into from
Dec 21, 2022

Conversation

simurai
Copy link
Contributor

@simurai simurai commented Dec 21, 2022

Description

This disables the is() selector for now. It seems to be causing issues with @csstools/postcss-is-pseudo-class. See primer/css#2349.

- :is(.Truncate > .Truncate-text) + .Truncate-text {
+ .Truncate > .Truncate-text + .Truncate-text {
      margin-left: var(--primer-control-small-gap, 4px);
  }

Verified in unpkg.com/.../truncate.css

Source

Example from truncate.pcss

.Truncate {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;

  & > .Truncate-text {
    min-width: 1ch;
    max-width: fit-content;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    & + .Truncate-text {
      margin-left: var(--primer-control-small-gap, 4px);
    }

    &.Truncate-text--primary {
      flex-basis: 200%;
    }

    &.Truncate-text--expandable:hover,
    &.Truncate-text--expandable:focus,
    &.Truncate-text--expandable:active {
      max-width: 100% !important;
      flex-shrink: 0;
      cursor: pointer;
    }
  }
}

Compiled

.Truncate {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
}

.Truncate > .Truncate-text {
  min-width: 1ch;
  max-width: -moz-fit-content;
  max-width: fit-content;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.Truncate > .Truncate-text + .Truncate-text {
  margin-left: var(--primer-control-small-gap, 4px);
}

.Truncate > .Truncate-text.Truncate-text--primary {
  flex-basis: 200%;
}

.Truncate > .Truncate-text.Truncate-text--expandable:hover,
.Truncate > .Truncate-text.Truncate-text--expandable:focus,
.Truncate > .Truncate-text.Truncate-text--expandable:active {
  max-width: 100% !important;
}

.Truncate > .Truncate-text.Truncate-text--expandable:hover,
.Truncate > .Truncate-text.Truncate-text--expandable:focus,
.Truncate > .Truncate-text.Truncate-text--expandable:active {
  flex-shrink: 0;
  cursor: pointer;
}

Integration

Does this change require any updates to code in production?

No

Merge checklist

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

@changeset-bot
Copy link

changeset-bot bot commented Dec 21, 2022

🦋 Changeset detected

Latest commit: 8c23972

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

@simurai simurai temporarily deployed to review-pr-1722 December 21, 2022 02:06 — with GitHub Actions Inactive
@simurai simurai temporarily deployed to github-pages December 21, 2022 02:11 — with GitHub Actions Inactive
@simurai simurai temporarily deployed to review-pr-1722 December 21, 2022 02:19 — with GitHub Actions Inactive
@simurai simurai temporarily deployed to github-pages December 21, 2022 02:22 — with GitHub Actions Inactive
postcss.config.js Outdated Show resolved Hide resolved
Co-authored-by: Jon Rohan <rohan@github.com>
@simurai simurai temporarily deployed to github-pages December 21, 2022 03:08 — with GitHub Actions Inactive
@simurai simurai marked this pull request as ready for review December 21, 2022 03:09
@simurai simurai requested a review from a team as a code owner December 21, 2022 03:09
@simurai simurai requested review from a team, rezrah, camertron and jonrohan December 21, 2022 03:09
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.

2 participants