Skip to content

Commit

Permalink
Allow :link Button scheme text label to wrap (#2750)
Browse files Browse the repository at this point in the history
Co-authored-by: langermank <langermank@users.noreply.github.com>
  • Loading branch information
langermank and langermank authored Apr 5, 2024
1 parent 6d0e233 commit ba87524
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/swift-fans-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@primer/view-components": patch
---

Allow `:link` Button scheme text label to wrap

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/components/primer/beta/button.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ summary.Button {
border: none;
height: unset;
padding: 0;
min-width: fit-content;

&:hover:not(:disabled, .Button--inactive) {
text-decoration: underline;
Expand All @@ -310,6 +311,10 @@ summary.Button {
border-color: transparent;
fill: var(--control-fgColor-disabled);
}

& .Button-label {
white-space: unset;
}
}

/* danger */
Expand Down
6 changes: 6 additions & 0 deletions previews/primer/beta/button_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@ def inactive(
"Button"
end
end

# @label Link scheme with long label
# @snapshot
def link_scheme_label_wrap
render_with_template(locals: {})
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div style="width: 200px;">
<%= render(Primer::Beta::Button.new(
scheme: :link,
size: :medium,
)) do %>
This is a button styled to look like a link that wraps like a link
<% end %>
</div>

0 comments on commit ba87524

Please sign in to comment.