[PR #619] [MERGED] Add marginX/marginY and paddingX/paddingY to the style attributes #1446

Closed
opened 2026-03-14 09:37:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/619
Author: @viralcodex
Created: 2/2/2026
Status: Merged
Merged: 2/4/2026
Merged by: @simonklee

Base: mainHead: padding-and-margin-X-and-Y


📝 Commits (5)

  • 21ba87c Add marginX/marginY and paddingX/paddingY setters
  • dec9944 Merge branch 'main' into padding-and-margin-X-and-Y
  • 2e58b04 Add axis-specific padding and margin examples
  • 6ab387e Merge branch 'main' into padding-and-margin-X-and-Y
  • 3a4383d prettier

📊 Changes

3 files changed (+172 additions, -0 deletions)

View changed files

📝 packages/core/src/Renderable.ts (+52 -0)
📝 packages/core/src/tests/yoga-setters.test.ts (+114 -0)
📝 packages/web/src/content/docs/core-concepts/layout.mdx (+6 -0)

📄 Description

Fixes: #618

Hi team,

Here's a small change that I have added.
X and Y attributes for both padding and margin just to make writing these values a little easier.

This is my first PR on this project and I am using this project for my own CLI tool I am building.

We can discuss and see if it fits with the project requirements.

But from a Dev experience point of view, I felt like I should add it to make it better, Also this aligns with people accustomed to tailwindCSS as well.

Here's a small demo:

https://github.com/user-attachments/assets/42d04e53-2006-435e-8e59-ef7d641ffe2f


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/619 **Author:** [@viralcodex](https://github.com/viralcodex) **Created:** 2/2/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@simonklee](https://github.com/simonklee) **Base:** `main` ← **Head:** `padding-and-margin-X-and-Y` --- ### 📝 Commits (5) - [`21ba87c`](https://github.com/anomalyco/opentui/commit/21ba87ca48a49bf30e106573874ae54a6475f522) Add marginX/marginY and paddingX/paddingY setters - [`dec9944`](https://github.com/anomalyco/opentui/commit/dec994465e69f8393a9d91f267c31282c08d9534) Merge branch 'main' into padding-and-margin-X-and-Y - [`2e58b04`](https://github.com/anomalyco/opentui/commit/2e58b04d7ffc9f32256a619ef0b169e7d46f0e45) Add axis-specific padding and margin examples - [`6ab387e`](https://github.com/anomalyco/opentui/commit/6ab387eebfff5d4effae127493209a93dd006738) Merge branch 'main' into padding-and-margin-X-and-Y - [`3a4383d`](https://github.com/anomalyco/opentui/commit/3a4383db71fa0741a09b7f19241515b28f843005) prettier ### 📊 Changes **3 files changed** (+172 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/Renderable.ts` (+52 -0) 📝 `packages/core/src/tests/yoga-setters.test.ts` (+114 -0) 📝 `packages/web/src/content/docs/core-concepts/layout.mdx` (+6 -0) </details> ### 📄 Description Fixes: #618 Hi team, Here's a small change that I have added. X and Y attributes for both padding and margin just to make writing these values a little easier. This is my first PR on this project and I am using this project for my own CLI tool I am building. We can discuss and see if it fits with the project requirements. But from a Dev experience point of view, I felt like I should add it to make it better, Also this aligns with people accustomed to tailwindCSS as well. Here's a small demo: https://github.com/user-attachments/assets/42d04e53-2006-435e-8e59-ef7d641ffe2f --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:37:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1446
No description provided.