Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Add theme hooks to source path element
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrovich committed Dec 16, 2018
1 parent 2f5381a commit 6a5a0a1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ Stylemark includes a number of CSS class hooks you can use to style specific ele
- `theme-content-element`: An element, including its title and documentation
- `theme-content-element-description`: An element's documentation, not including its title
- `theme-content-element-title`: An element's title
- `theme-content-element-source`: An element's source filepath container
- `theme-content-element-source-label`: The text label of an element's source filepath
- `theme-content-element-source-path`: The filepath string of an element's source filepath
- `theme-mobile-nav`: The navigation view visible on smaller viewports
- `theme-mobile-nav-select`: The `<select>` tag for the navigation dropdown visible on smaller viewports
- `theme-page`: The entire page, including the content and sidebar
Expand Down
13 changes: 13 additions & 0 deletions src/assets/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,16 @@
font-size: 14px;
opacity: 0.3;
}

.theme-content-element-source {
display: block;
font-size: 14px;
color: #888;
}
.theme-content-element-source-label {
font-weight: 700;
text-transform: uppercase;
}
.theme-content-element-source-path {
font-family: "Source Code Pro", "Courier New", Courier, monospace;
}
5 changes: 4 additions & 1 deletion src/templates/doc.handlebars
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div id="{{doc.slug}}" class="i-library theme-content-element">
<h1 class="display-4 theme-content-element-title">{{doc.name}}</h1>
<span class="i-example__heading"><i class="fa fa-info-circle"></i> From file: {{doc.filepath}}</span>
<span class="theme-content-element-source">
<span class="theme-content-element-source-label">Source:</span>
<span class="theme-content-element-source-path">{{doc.filepath}}</span>
</span>
<div class="theme-content-element-description">{{markdown doc.description}}</div>
</div>

0 comments on commit 6a5a0a1

Please sign in to comment.