Skip to content

Commit ed8dcef

Browse files
authored
resolves #43 add styles for home page (PR #44)
1 parent b8b0529 commit ed8dcef

File tree

5 files changed

+130
-1
lines changed

5 files changed

+130
-1
lines changed

gulp.d/tasks/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ module.exports = (src, dest, preview) => () => {
101101
// NOTE use this statement to bundle a JavaScript library that cannot be browserified, like jQuery
102102
//vfs.src(require.resolve('<package-name-or-require-path>'), opts).pipe(concat('js/vendor/<library-name>.js')),
103103
vfs
104-
.src(['css/site.css', 'css/vendor/*.css'], { ...opts, sourcemaps })
104+
.src(['css/site.css', 'css/home.css', 'css/vendor/*.css'], { ...opts, sourcemaps })
105105
.pipe(postcss((file) => ({ plugins: postcssPlugins, options: { file } }))),
106106
vfs.src('font/*.{ttf,woff*(2)}', opts),
107107
vfs.src('img/**/*.{gif,ico,jpg,png,svg}', opts).pipe(

preview-src/home.adoc

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
= Home Page Title
2+
:navtitle: Home
3+
:page-role: home
4+
5+
Welcome to the home page!
6+
7+
[.panel]
8+
--
9+
[discrete]
10+
== xref:home.adoc[First hero panel]
11+
12+
Content for hero panel.
13+
--
14+
15+
[.panel]
16+
--
17+
[discrete]
18+
== xref:home.adoc[Another hero panel]
19+
20+
Content for hero panel.
21+
--
22+
23+
[discrete]
24+
=== Things
25+
26+
Introduction of things.
27+
28+
[.grid]
29+
Thing A::
30+
Description of thing A.
31+
32+
Thing B::
33+
Description of thing B.
34+
35+
Thing C::
36+
Description of thing C.
37+
38+
[discrete]
39+
=== Explore topics
40+
41+
[.grid]
42+
Topic A::
43+
Description of topic A.
44+
45+
* xref:#[Quicklink 1]
46+
* xref:#[Quicklink 2]
47+
* xref:#[Quicklink 3]
48+
49+
Topic B::
50+
Description of topic B.
51+
52+
Topic C::
53+
Description of topic C.
54+
55+
Topic D::
56+
Description of topic D.

src/css/home.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
@import "vars.css";
2+
3+
.doc .panel {
4+
margin-top: 1rem;
5+
background-color: var(--color-smoke-50);
6+
border-radius: 0.5em;
7+
padding: 0.75rem 1.25rem;
8+
font-size: 0.8888rem;
9+
}
10+
11+
.doc .panel h2 {
12+
font-size: 1rem;
13+
font-weight: var(--body-font-weight-bold);
14+
padding-bottom: 0.25rem;
15+
}
16+
17+
.doc .panel h2,
18+
.doc .panel h2 + * {
19+
margin-top: 0;
20+
}
21+
22+
.doc h3 {
23+
margin-top: 2rem;
24+
}
25+
26+
.doc .grid {
27+
margin-top: 1rem;
28+
font-size: 0.8888rem;
29+
}
30+
31+
@media screen and (min-width: 769px) {
32+
.doc .grid dl {
33+
display: grid;
34+
grid-auto-columns: 1fr;
35+
grid-auto-flow: row;
36+
grid-gap: 0.25rem 1rem;
37+
}
38+
39+
.doc .grid dt {
40+
grid-row: 1;
41+
font-style: normal;
42+
padding-right: 0;
43+
}
44+
45+
.doc .grid dd {
46+
margin: 0;
47+
}
48+
}
49+
50+
.doc .grid .ulist {
51+
margin-top: 0;
52+
line-height: 1.3;
53+
}
54+
55+
.doc .grid ul {
56+
padding-left: 0;
57+
list-style: none;
58+
}
59+
60+
.doc .grid ul li {
61+
margin-top: 0.15em;
62+
margin-bottom: 0;
63+
hyphens: none;
64+
}
65+
66+
.doc .grid ul a {
67+
font-weight: var(--body-font-weight-bold);
68+
}

src/partials/head-styles.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
<link rel="stylesheet" href="{{{uiRootPath}}}/css/site.css">
2+
{{#if (eq page.attributes.role 'home')}}
3+
<link rel="stylesheet" href="{{{uiRootPath}}}/css/home.css">
4+
{{/if}}

src/partials/toc.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
{{#unless (eq page.attributes.role 'home')}}
12
{{#if (matches page.contents ' class="sect[01]"')}}
23
<aside class="toc sidebar" data-title="{{or page.attributes.toctitle 'Contents'}}" data-levels="{{{or page.attributes.toclevels 2}}}">
34
<div class="toc-menu"></div>
45
</aside>
56
{{/if}}
7+
{{/unless}}

0 commit comments

Comments
 (0)