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

feat(fw-label): introduce css variables for label padding #182

Merged
merged 1 commit into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/components/label/label.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
@import "../../styles/freshworks.scss";

/**
@prop --label-padding-vertical: Top - bottom padding for label
@prop --label-padding-horizontal: Left - right padding for label
*/

:host {
--label-padding-vertical: 0;
--label-padding-horizontal: 5px;
}

.label {
color: #6f7c87;
border: 1px solid #dadfe3;
background-color: var(--color-milk);
font-weight: 600;
font-size: var(--font-size-12);
padding: 0 5px;
padding: var(--label-padding-vertical) var(--label-padding-horizontal);
line-height: 1.5;
display: inline-block;
border-radius: 2px;
Expand Down
8 changes: 8 additions & 0 deletions src/components/label/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ fw-label displays an informational text component that identifies other componen
| `value` | `value` | Display text in the label. | `string` | `''` |


## CSS Custom Properties

| Name | Description |
| ---------------------------- | ------------------------------ |
| `--label-padding-horizontal` | Left - right padding for label |
| `--label-padding-vertical` | Top - bottom padding for label |


----------------------------------------------

Built with ❤ at Freshworks
2 changes: 2 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
<option id="12" value="Yifi torrents">Yifi torrents</option>
</div>
</fw-dropdown-button>

<fw-label color="red" value="wfwefwe" style="--label-padding-vertical: 10px; --label-padding-horizontal:20px" />
<br>

<script>
Expand Down