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

Prevent rounded corners in the middle of a BorderBox #2686

Closed
Closed
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
5 changes: 5 additions & 0 deletions .changeset/proud-pens-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/view-components": patch
---

Prevent rounded corners in the middle of a Primer::Beta::BorderBox
5 changes: 2 additions & 3 deletions app/components/primer/beta/border_box.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
border-bottom: var(--borderWidth-thin) solid var(--borderColor-default);

/* Ensures bottom-border doesn't poke out when .Box-body used without box-footer */
&:last-of-type {
&:last-child {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An issue with this selector is we often have hidden elements at the end of the rows in our markup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to re-create such an example, but failed. When looking at the html of the BorderBox, there is no hidden element defined, and the slot definitions do not accept blocks as arguments either.

<%= render Primer::BaseComponent.new(**@system_arguments) do %>
  <%= header %>
  <%= body %>
  <% if rows.any? %>
    <%= render Primer::BaseComponent.new(**@list_arguments) do %>
      <% rows.each do |row| %>
        <%= row %>
      <% end %>
    <% end %>
  <% end %>
  <%= footer %>
<% end %>

Could you give me a hint, on how to create an example with hidden elements at the end of the rows?

margin-bottom: calc(var(--borderWidth-thin) * -1);
border-bottom-right-radius: var(--borderRadius-medium);
border-bottom-left-radius: var(--borderRadius-medium);
Expand All @@ -106,8 +106,7 @@
border-top-width: var(--borderWidth-thin);

&:first-of-type {
border-top-left-radius: var(--borderRadius-medium);
border-top-right-radius: var(--borderRadius-medium);
border-top-width: 0;
}

&:last-of-type {
Expand Down
Loading