Skip to content

Commit be86fa2

Browse files
authored
Merge pull request #166 from Raclamusi/fix_badge
説明専用バッジのスタイル定義を crsearch に移動
2 parents 073f6eb + b4a52b3 commit be86fa2

File tree

6 files changed

+17
-51
lines changed

6 files changed

+17
-51
lines changed

css/kunai/site/badge-ext.scss

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,6 @@ main[role="main"] {
1717

1818
span.cpp {
1919
@include cr-badge;
20-
21-
&.exposition-only {
22-
border-color: #666;
23-
color: #666;
24-
font-style: italic;
25-
26-
i {
27-
display: none;
28-
}
29-
30-
&::before {
31-
@include fa-patch;
32-
content: "\f24a"; // fa-sticky-note-o
33-
}
34-
35-
&::after {
36-
content: "説明専用";
37-
}
38-
}
3920
}
4021
}
4122
}

css/kunai/site/sidebar-ext.scss

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -140,29 +140,6 @@
140140

141141
> .title > ul.badges {
142142
@include cr-badge-auto(".badge");
143-
144-
> li.badge[data-original-attr="exposition-only"] {
145-
border-color: #666;
146-
color: #666;
147-
font-style: italic;
148-
149-
a {
150-
color: #666;
151-
152-
i {
153-
display: none;
154-
}
155-
156-
&::before {
157-
@include fa-patch;
158-
content: "\f24a"; // fa-sticky-note-o
159-
}
160-
}
161-
}
162-
163-
&.simple > li.badge[data-original-attr="exposition-only"] a::after {
164-
display: block;
165-
}
166143
}
167144
}
168145
}

css/kunai/site/sidebar.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,8 @@ main[role="main"] .kunai-sidebar.force-legacy {
744744
ul.others > li.other {
745745
.cr-index {
746746
ul.keys {
747-
display: inline-block;
747+
display: inline-flex;
748+
flex-direction: row;
748749
padding-left: 2px;
749750
> li.key {
750751
display: inline-block;

js/kunai/ui/badge.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const sanitize = (badges) => {
2222
let deprecated_or_removed = false
2323
let cppv = null
2424
let named_version = null
25+
let exposition_only = false
2526
for (const c of b_classes) {
2627
if (/^(?:future|archive)$/.test(c)) {
2728
named_version = c
@@ -30,6 +31,11 @@ const sanitize = (badges) => {
3031
continue
3132
}
3233

34+
if (c === 'exposition-only') {
35+
exposition_only = true
36+
classes.push('exposition-only-spec')
37+
}
38+
3339
const cppm = c.match(/^cpp(\d[\da-zA-Z])(.*)$/)
3440
if (!cppm) continue;
3541

@@ -55,6 +61,7 @@ const sanitize = (badges) => {
5561

5662
const lang_path = cppv ? `/lang/cpp${cppv}` :
5763
named_version ? `/lang/${named_version}` :
64+
exposition_only ? '/reference/exposition-only' :
5865
`/lang`
5966
const a_elem = $('<a>', {href: `${lang_path}.html`})
6067
.append($('<i>'))

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"anser": "^1.4.9",
7575
"codemirror": "^5.55.0",
7676
"commonmark": "^0.29.1",
77-
"crsearch": "cpprefjp/crsearch#cce4f38cf8e8e6710ab8d3a6e8cb308cd6e6ac13",
77+
"crsearch": "cpprefjp/crsearch#61b8f30da8b694275957a23ca6cb8e855c7f4bf9",
7878
"font-awesome": "^4.7.0",
7979
"jquery": "^3.5.1",
8080
"normalize.css": "^8.0.1",

0 commit comments

Comments
 (0)