Skip to content
Open
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
6 changes: 2 additions & 4 deletions app/components/op_primer/inline_macro_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>

<%= render(Primer::BaseComponent.new(tag: :span, **@system_arguments)) do %>
<%= render(Primer::BaseComponent.new(tag: :span, display: :inline_flex, align_items: :center)) do %>
<%= leading_visual_icon %>
<%= content %>
<% end %>
<%= leading_visual_icon %>
<%= content -%>
<% end %>
2 changes: 1 addition & 1 deletion app/components/op_primer/inline_macro_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
module OpPrimer
class InlineMacroComponent < Primer::Component
renders_one :leading_visual_icon, ->(icon:, color: :muted) do
Primer::Beta::Octicon.new(icon:, color:, size: :xsmall, mr: 2)
Primer::Beta::Octicon.new(icon:, color:, size: :xsmall, mr: 1, vertical_align: :middle, classes: "op-inline-macro--icon")
end

def initialize(**system_arguments)
Expand Down
5 changes: 5 additions & 0 deletions app/components/op_primer/inline_macro_component.sass
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.op-inline-macro
@include macro--text-style

.op-inline-macro--icon
// Fixing vertical alignment compared to text next to it
// maybe replace with "vertical-align: center" or "central" once they are widely supported
margin-bottom: 2px
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<p>
A component commonly used inline is the <%= render(OpPrimer::InlineMacroComponent.new) { |c| c.with_leading_visual_icon(icon: :book); "InlineMacroComponent" } %>. It
can appear in the middle of other text.
A component commonly used inline is the <%= render(OpPrimer::InlineMacroComponent.new) { |c| c.with_leading_visual_icon(icon: :book); "InlineMacroComponent" } %>.

Check failure on line 2 in lookbook/previews/op_primer/inline_macro_component_preview/with_surrounding_text.html.erb

View workflow job for this annotation

GitHub Actions / ERB lint

[erb_lint] reported by reviewdog 🐶 Style/Semicolon: Do not use semicolons to terminate expressions. Raw Output: lookbook/previews/op_primer/inline_macro_component_preview/with_surrounding_text.html.erb:2:134: Style/Semicolon: Do not use semicolons to terminate expressions.
It can appear in the middle of other text.
When <%= render(OpPrimer::InlineMacroComponent.new) { |c| c.with_leading_visual_icon(icon: :book); "it contains a longer sentence it can also" } %> wrap multiple lines without issue.

Check failure on line 4 in lookbook/previews/op_primer/inline_macro_component_preview/with_surrounding_text.html.erb

View workflow job for this annotation

GitHub Actions / ERB lint

[erb_lint] reported by reviewdog 🐶 Style/Semicolon: Do not use semicolons to terminate expressions. Raw Output: lookbook/previews/op_primer/inline_macro_component_preview/with_surrounding_text.html.erb:4:99: Style/Semicolon: Do not use semicolons to terminate expressions.

@NobodysNightmare NobodysNightmare Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ERBLint doesn't like the ; usage here. I'd prefer to keep it so that the component is visibly inline.

I can add some wrapping inside the ERB, but I'd prefer to not ^^

</p>
Loading