chore(fe): remove Text pseudo-element padding#7665
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryReverts the pseudo-element padding approach that was added in PR #7226. The change removes the
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Text as Text Component
participant DOM as DOM/Browser
Note over Dev,DOM: Previous Implementation (with pseudo-elements)
Dev->>Text: Render Text with content
Text->>DOM: Apply before::pl-[2px] pseudo-element
Text->>DOM: Render text content
Text->>DOM: Apply after::pr-[2px] pseudo-element
DOM-->>Dev: Result: 2px + content + 2px (causes offset issues)
Note over Dev,DOM: Current Implementation (no pseudo-elements)
Dev->>Text: Render Text with content
Text->>DOM: Render text content directly
DOM-->>Dev: Result: content only (consistent spacing)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
There are also cases where padding in the pseudo-elements is causing undesired behavior, https://onyx-company.slack.com/archives/C0832RVRVG8/p1769050433567939.
It may be possible to use pseudo-elements in combination with this
box-decoration-clone, but also, I think my proposal to requirechildrenprops of theTextto be inline-able type (strings, numbers, etc. not ReactNodes) is valid.Either case requires a bit of work, so let's get something temporary in.
I'm also down to re-apply this to the
Tagdirectly. I don't think that's the proper long-term solution, but I agree it's better than this current behavior.Additional Options
Summary by cubic
Removed before/after pseudo-element padding from Text to stop unintended horizontal spacing and 2px offsets when used with other padded elements or Tags. This makes Text spacing consistent and avoids layout glitches in inline contexts.
Written for commit 56e4095. Summary will update on new commits.