Skip to content

Commit 50678fb

Browse files
authored
Merge pull request #6 from bit-docs/static-asset
Add static asset highlight-line.less
2 parents b7dc96a + be799ab commit 50678fb

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

highlight-line.js renamed to index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require("./static/styles/highlight-line.less");
12
var $ = require("jquery");
23

34
var getLines = function(lineString) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "bit-docs-html-highlight-line",
33
"version": "0.2.3",
44
"description": "Highlight a line in source code",
5-
"main": "highlight-line.js",
5+
"main": "index.js",
66
"scripts": {
77
"preversion": "npm test",
88
"test": "mocha test.js --reporter spec",

static/styles/highlight-line.less

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
@import "locate://bit-docs-site/styles/variables.less";
2+
3+
/**
4+
* @parent bit-docs-html-highlight-line/static
5+
* @module bit-docs-html-highlight-line/static/styles/highlight-line.less
6+
*
7+
* @description Base styles for highlight tag.
8+
*
9+
* @body
10+
*
11+
* Adds styling for the `.expand` element.
12+
*
13+
* The `.expand` element gets added onload when the `only` option is used with
14+
* the highlight tag, and the code block has lines before/after the highlight.
15+
*/
16+
article {
17+
code {
18+
.expand {
19+
color: black;
20+
padding: 4px 0px;
21+
text-align: center;
22+
background-color: #eee;
23+
border-top: 1px solid #ccc;
24+
border-bottom: 1px solid #ccc;
25+
}
26+
.expand:before {
27+
width: 15px;
28+
height: 15px;
29+
margin: 0 auto;
30+
display: block;
31+
content: '⇅ EXPAND ⇅';
32+
}
33+
.expand:hover {
34+
opacity: .6;
35+
cursor: pointer;
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)