Skip to content

Commit ba87524

Browse files
authored
Allow :link Button scheme text label to wrap (#2750)
Co-authored-by: langermank <[email protected]>
1 parent 6d0e233 commit ba87524

File tree

6 files changed

+25
-0
lines changed

6 files changed

+25
-0
lines changed

.changeset/swift-fans-march.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@primer/view-components": patch
3+
---
4+
5+
Allow `:link` Button scheme text label to wrap
6+

app/components/primer/beta/button.pcss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ summary.Button {
293293
border: none;
294294
height: unset;
295295
padding: 0;
296+
min-width: fit-content;
296297

297298
&:hover:not(:disabled, .Button--inactive) {
298299
text-decoration: underline;
@@ -310,6 +311,10 @@ summary.Button {
310311
border-color: transparent;
311312
fill: var(--control-fgColor-disabled);
312313
}
314+
315+
& .Button-label {
316+
white-space: unset;
317+
}
313318
}
314319

315320
/* danger */

previews/primer/beta/button_preview.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@ def inactive(
361361
"Button"
362362
end
363363
end
364+
365+
# @label Link scheme with long label
366+
# @snapshot
367+
def link_scheme_label_wrap
368+
render_with_template(locals: {})
369+
end
364370
end
365371
end
366372
end
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div style="width: 200px;">
2+
<%= render(Primer::Beta::Button.new(
3+
scheme: :link,
4+
size: :medium,
5+
)) do %>
6+
This is a button styled to look like a link that wraps like a link
7+
<% end %>
8+
</div>

0 commit comments

Comments
 (0)