Skip to content

[diffs] Remove necessary set shorthands and defaults#741

Open
Que-tin wants to merge 1 commit into
pierrecomputer:mainfrom
Que-tin:remove-necessary-set-shorthands-and-defaults
Open

[diffs] Remove necessary set shorthands and defaults#741
Que-tin wants to merge 1 commit into
pierrecomputer:mainfrom
Que-tin:remove-necessary-set-shorthands-and-defaults

Conversation

@Que-tin

@Que-tin Que-tin commented May 24, 2026

Copy link
Copy Markdown

Description

This is the first of a couple isolated PRs to improve the stylings of diffs.

It removes necessary shorthands that under the hood set or reset way too many properties that aren't even used and also removes a couple of stylings that I stumbled upon that are user agent defaults across browsers anyways.

I'll comment each individual change in the PR, check there for more info

Motivation & Context

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality). You must have
    first discussed with the dev team and they should be aware that this PR is
    being opened
  • Breaking change (fix or feature that would change existing functionality).
    You must have first discussed with the dev team and they should be aware
    that this PR is being opened
  • Documentation update

Checklist

  • I have read the
    contributing guidelines
  • My code follows the code style of the project (bun run lint)
  • My code is formatted properly (bun run format)
  • I have updated the documentation accordingly (if applicable)
  • I have added tests to cover my changes (if applicable)
  • All new and existing tests pass (bun run diffs:test)

How was AI used in generating this PR

Not at all.

@vercel

vercel Bot commented May 24, 2026

Copy link
Copy Markdown

@Que-tin is attempting to deploy a commit to the Pierre Computer Company Team on Vercel.

A member of the Team first needs to authorize it.

padding: 0;
display: block;
outline: none;
outline-style: none;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Literally the same, without other properties being set under the hood


[data-code]::-webkit-scrollbar-track {
background: transparent;
background-color: transparent;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Literally the same, without other properties being set under the hood.

Also already commonly used across the file

[data-expand-button],
[data-separator-content] {
display: flex;
flex: 0 0 auto;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This was unnecessary.

flex-grow: 0 is the default.
Same goes with flex-basis: auto.

[data-expand-button] was already setting flex-shrink: 0 individually

[data-separator-content] was overriding the whole thing anyway (see next comment)


[data-separator-content] {
flex: 1 1 auto;
flex-grow: 1;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same as above

min-width: 0;
text-overflow: ellipsis;
white-space: nowrap;
flex: 0 1 auto;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

These are basically the UA-defaults

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I personally prefer to see these types of flex values in context because you don't have to remember ua defaults and you can see what is being defined explicitly.

display: flex;
align-items: center;
gap: 1ch;
column-gap: 1ch;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We have a default flexbox no need to set row-gap as well

align-items: center;
justify-content: center;
border: none;
border-style: none;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same as with outline -> outline-style


[data-header-content] {
display: flex;
flex-direction: row;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

UA-Default

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar note above, I personally prefer the context here to help establish what's happening with layout.

position: relative;
background-color: var(--diffs-bg);
display: flex;
flex-direction: row;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

UA-Default

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know this probably isn't needed, but i am a fan of seeing the direction listed out here to help establish context.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Interesting. Will revert the changes then.

Out of curiosity where do you draw the line?

I mean you also don't define display: block or inline on each element or the font-sizes, weights and family. What part of the cascade or UAs is "worth" ignoring and which part is worth redefining?

Really interested to get some insights in the thought process behind this, never stumbled across such pattern. 😊

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There’s no hard and fast rule I have here, some of it stems from my experience working in react native where the default direction is column. There’s likely inconsistencies in this file already to begin with, but if intentional changes are happening I would prefer explicitness over ambiguity.

Comment on lines +1540 to +1541
border-style: none;
background-color: transparent;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same as at the start

@amadeus amadeus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Most of these I'm good with, but I do have a bit of a stylistic preference in being more explicit around flex properties. So ideally we keep those but the rest look good to me. Given this PR was opened a while ago (sorry for the delays, a lot going on), you might need a rebase to catch up and it might involve some additional changes.

position: relative;
background-color: var(--diffs-bg);
display: flex;
flex-direction: row;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know this probably isn't needed, but i am a fan of seeing the direction listed out here to help establish context.


[data-header-content] {
display: flex;
flex-direction: row;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar note above, I personally prefer the context here to help establish what's happening with layout.

min-width: 0;
text-overflow: ellipsis;
white-space: nowrap;
flex: 0 1 auto;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I personally prefer to see these types of flex values in context because you don't have to remember ua defaults and you can see what is being defined explicitly.

@amadeus amadeus changed the title Remove necessary set shorthands and defaults [diffs] Remove necessary set shorthands and defaults Jun 10, 2026
@amadeus amadeus mentioned this pull request Jun 10, 2026
11 tasks
@Que-tin

Que-tin commented Jun 11, 2026

Copy link
Copy Markdown
Author

Most of these I'm good with, but I do have a bit of a stylistic preference in being more explicit around flex properties. So ideally we keep those but the rest look good to me. Given this PR was opened a while ago (sorry for the delays, a lot going on), you might need a rebase to catch up and it might involve some additional changes.

Will look into it as soon as I'm back from conference. 👍🏻

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