Skip to content

Commit

Permalink
ButtonGroup: Change reset selector to use .Button class (#2072)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan authored Jun 12, 2023
1 parent aa8b1e2 commit 70086f5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-vans-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/view-components": patch
---

ButtonGroup: Change reset selector to use .Button class
6 changes: 3 additions & 3 deletions app/components/primer/beta/button_group.pcss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.ButtonGroup {
display: inline-flex;

& button {
& .Button {
margin-inline-end: -1px;
position: relative;
border-radius: 0;
Expand All @@ -14,13 +14,13 @@
}

& > :first-child,
& > :first-child.Button-withTooltip button {
& > :first-child.Button-withTooltip .Button {
border-top-left-radius: var(--borderRadius-medium);
border-bottom-left-radius: var(--borderRadius-medium);
}

& > :last-child,
& > :last-child.Button-withTooltip button {
& > :last-child.Button-withTooltip .Button {
border-top-right-radius: var(--borderRadius-medium);
border-bottom-right-radius: var(--borderRadius-medium);
}
Expand Down
18 changes: 18 additions & 0 deletions previews/primer/beta/button_group_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ def icon_buttons(size: :medium)
component.with_button(icon: "sort-desc", "aria-label": "button 3")
end
end

# @label Button group with all tags
def all_tags
render(Primer::Beta::ButtonGroup.new) do |component|
component.with_button(id: "button-1", tag: :button) do |component|
component.with_tooltip(text: "Button Tooltip")
"Button 1"
end
component.with_button(id: "button-2", tag: :a) do |component|
component.with_tooltip(text: "Button Tooltip")
"Button 2"
end
component.with_button(id: "button-3", tag: :summary) do |component|
component.with_tooltip(text: "Button Tooltip")
"Button 3"
end
end
end
end
end
end

0 comments on commit 70086f5

Please sign in to comment.