Skip to content

Commit

Permalink
Fix layout width calculations (#9)
Browse files Browse the repository at this point in the history
<!-- If this pull request closes an issue, please mention the issue
number below -->
Closes # <!-- Issue # here -->

## 💸 TL;DR
<!-- What's the three sentence summary of purpose of the PR -->

The width was always two pixels off because the border is two pixels.
This is a lot more noticable now that we have `context.dimensions`.
Added a calc to make it right.

![CleanShot 2024-04-10 at 15 34
42@2x](https://github.com/reddit/play/assets/153219522/2ca24611-fee7-4f69-8193-be830f0f6677)


## 📜 Details
[Design Doc](<!-- insert Google Doc link here if applicable -->)

[Jira](<!-- insert Jira link if applicable -->)

<!-- Add additional details required for the PR: breaking changes,
screenshots, external dependency changes -->

## 🧪 Testing Steps / Validation
<!-- add details on how this PR has been tested, include reproductions
and screenshots where applicable -->

## ✅ Checks
<!-- Make sure your pr passes the CI checks and do check the following
fields as needed - -->
- [x] CI tests (if present) are passing
- [x] Adheres to code style for repo
- [x] Contributor License Agreement (CLA) completed if not a Reddit
employee
  • Loading branch information
UnluckyHuckleberry53 authored Apr 11, 2024
1 parent 3e48614 commit c7c0acd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/elements/play-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export class PlayPreview extends LitElement {
border-radius: 16px;
min-height: 320px;
box-shadow: var(--shadow-xs);
/* Prevents the border from throwing off the context.dimensions calculation */
box-sizing: content-box;
/* When the background is visible, the preview is loading. */
background-color: var(--color-interactive-background);
Expand Down

0 comments on commit c7c0acd

Please sign in to comment.