Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!-- Default -->
<div data-view-component="true" class="Subhead">
<div data-view-component="true" class="Subhead-heading Subhead-heading--large">Default Spacing</div>
<div data-view-component="true" class="Subhead-description">Default spacing above the component</div>
</div>
<!-- Spacious -->
<div data-view-component="true" class="Subhead Subhead--spacious">
<div data-view-component="true" class="Subhead-heading Subhead-heading--large">Spacious</div>
<div data-view-component="true" class="Subhead-description">With extra space above the component</div>
</div>
<!-- Spacious w/ Danger Heading -->
<div data-view-component="true" class="Subhead Subhead--spacious">
<div data-view-component="true" class="Subhead-heading Subhead-heading--large Subhead-heading--danger">Danger Heading</div>
<div data-view-component="true" class="Subhead-description">With extra space above the component, and a 'danger' heading</div>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Default
render(Primer::Beta::Subhead.new(spacious: false)) do |component|
component.with_heading do
"Default Spacing"
end
component.with_description do
"Default spacing above the component"
end
end
# Spacious
render(Primer::Beta::Subhead.new(spacious: true)) do |component|
component.with_heading do
"Spacious"
end
component.with_description do
"With extra space above the component"
end
end
# Spacious w/ Danger Heading
render(Primer::Beta::Subhead.new(spacious: true)) do |component|
component.with_heading(danger: true) do
"Danger Heading"
end
component.with_description do
"With extra space above the component, and a 'danger' heading"
end
end

app/components/primer/beta/subhead.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* Subhead */
.Subhead {
display: flex;
padding-bottom: var(--stack-padding-condensed,0.5rem);
margin-bottom: var(--stack-gap-normal,1rem);
border-bottom: var(--borderWidth-thin,max(1px, 0.0625rem)) solid var(--borderColor-muted,var(--color-border-muted));
flex-flow: row wrap;
justify-content: flex-end; /* Keep actions right aligned. */
}
/* Modifier class to give a lot of breathing room between sections of content. */
.Subhead--spacious {
margin-top: var(--base-size-40,2.5rem);
}
/* <h2> sized heading with normal font weight */
.Subhead-heading {
font-weight: var(--base-text-weight-normal,400);
flex: 1 1 auto;
order: 0;
}
.Subhead-heading--large {
font-size: var(--base-size-24,1.5rem);
}
.Subhead-heading--medium {
font-size: var(--text-title-size-medium,1.25rem);
}
/* Make the text bold and red for dangerous content */
.Subhead-heading--danger {
font-weight: var(--base-text-weight-semibold,600);
color: var(--fgColor-danger,var(--color-danger-fg));
}
/* One-liner of supporting text */
.Subhead-description {
font-size: var(--text-body-size-medium,0.875rem);
color: var(--fgColor-muted,var(--color-fg-muted));
flex: 1 100%;
order: 2;
}
/* Add 1 or 2 buttons to the right of the heading */
.Subhead-actions {
margin: var(--base-size-4,0.25rem) 0 var(--base-size-4,0.25rem) var(--base-size-4,0.25rem);
align-self: center;
justify-content: flex-end;
order: 1;
}
.Subhead-actions + .Subhead-description {
margin-top: var(--base-size-4,0.25rem);
}