Skip to content

Commit d531074

Browse files
authored
Merge pull request #339 from opf/bug/65252-links-in-descriptive-text-not-distinguishable-enough
[65252] Links in descriptive text not distinguishable enough
2 parents 430c49c + 18dc9e1 commit d531074

File tree

7 files changed

+41
-0
lines changed

7 files changed

+41
-0
lines changed

.changeset/hip-items-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openproject/primer-view-components': patch
3+
---
4+
5+
Add link underline effect to PageHeader descriptions and FormControl captions

app/components/primer/alpha/text_field.pcss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
color: var(--fgColor-muted);
3535
}
3636

37+
.FormControl-caption a {
38+
text-decoration: underline;
39+
}
40+
3741
/* inline validation message */
3842
.FormControl-inlineValidation {
3943
display: flex;

app/components/primer/open_project/page_header.pcss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
flex: 1 100%;
4848
}
4949

50+
.PageHeader-description a {
51+
/* Ensure the accessibility is met, given that the description is written in light grey */
52+
text-decoration: underline;
53+
}
54+
5055
.PageHeader-tabNavBar {
5156
overflow: auto;
5257
}

previews/primer/open_project/page_header_preview.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ def skip_breadcrumb_item
266266
"Baz"])
267267
end
268268
end
269+
270+
# @label With a link in the description
271+
def description
272+
render_with_template(template: "primer/open_project/page_header_preview/description")
273+
end
269274
end
270275
end
271276
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<%= render(Primer::OpenProject::PageHeader.new) do |component| %>
2+
<% component.with_title do %>
3+
Great news
4+
<% end %>
5+
<% component.with_description do %>
6+
<%= render(Primer::Beta::Text.new) do %>
7+
Last updated by
8+
<%= render(Primer::Beta::Link.new(href: "/foo")) {"user Foo"} %>
9+
<% end %>
10+
<% end %>
11+
<% component.with_breadcrumbs([{ href: "/foo", text: "Foo" }, { href: "/bar", text: "Bar" }, "Baz"]) %>
12+
<% end %>

test/css/component_specific_selectors_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class ComponentSpecificSelectorsTest < Minitest::Test
6969
".FormControl-inlineValidation--success",
7070
".FormControl-checkbox",
7171
".FormControl-radio",
72+
".FormControl-caption a"
7273
],
7374
Primer::Alpha::ButtonMarketing => [
7475
".btn-mktg.disabled",

test/system/open_project/page_header_test.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,13 @@ def test_renders_component
88

99
assert_selector(".PageHeader")
1010
end
11+
12+
def test_highlights_links_in_description
13+
visit_preview(:description)
14+
15+
assert_selector(".PageHeader-description")
16+
assert_selector(".PageHeader-description a") do |link|
17+
link.assert_matches_style("text-decoration-line" => "underline")
18+
end
19+
end
1120
end

0 commit comments

Comments
 (0)