Skip to content

Commit e84b131

Browse files
jawinncastastrophe
authored andcommitted
feat(button): mod property for icon margin top
Add a mod property to make it easy to modify the margin-block-start of the icon, in case of alignment issues with icons that are not the intended workflow sizes.
1 parent 570d19f commit e84b131

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

components/button/index.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@ governing permissions and limitations under the License.
155155
var(--spectrum-icon-block-size, var(--spectrum-button-intended-icon-size))
156156
);
157157

158-
margin-block-start: max(0px,
159-
var(--mod-button-top-to-icon, var(--spectrum-button-top-to-icon)) -
160-
var(--mod-button-border-width, var(--spectrum-button-border-width)) +
161-
(var(--_icon-size-difference, 0px) / 2)
158+
margin-block-start: var(--mod-button-icon-margin-block-start,
159+
max(0px,
160+
var(--mod-button-top-to-icon, var(--spectrum-button-top-to-icon)) -
161+
var(--mod-button-border-width, var(--spectrum-button-border-width)) +
162+
(var(--_icon-size-difference, 0px) / 2)
163+
)
162164
);
163165

164166
margin-inline-start: calc(

components/button/metadata/mods.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
| `--mod-button-font-family` |
3333
| `--mod-button-font-size` |
3434
| `--mod-button-height` |
35+
| `--mod-button-icon-margin-block-start` |
3536
| `--mod-button-line-height` |
3637
| `--mod-button-margin-block` |
3738
| `--mod-button-margin-left` |

0 commit comments

Comments
 (0)