Skip to content

Commit 97ce1c4

Browse files
committed
Update docFx Template
- Use new logo (rebranding) - Re-introduce the search icon in the Nav->Search control - Fix formatting issue with toc expand char "›" - Update alignment + spacing around the icon in the Toc->Filter control
1 parent 8f78cf8 commit 97ce1c4

File tree

5 files changed

+120
-58
lines changed

5 files changed

+120
-58
lines changed

RWSTemplate/logo.svg

Lines changed: 33 additions & 12 deletions
Loading

RWSTemplate/partials/navbar.tmpl.partial

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<div class="collapse navbar-collapse" id="navbar">
1515
<form class="navbar-form navbar-right" role="search" id="search">
1616
<div class="form-group">
17+
<span class="glyphicon glyphicon-search search-icon"></span>
1718
<input type="text" class="form-control" id="search-query" placeholder="{{__global.search}}" autocomplete="off">
1819
</div>
1920
</form>

RWSTemplate/styles/docfx.css

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ a {
2626
cursor: pointer;
2727
}
2828

29+
#logo {
30+
margin-top: 6px;
31+
vertical-align: middle;
32+
max-width: 100%;
33+
height: auto;
34+
display: block;
35+
width: 209px;
36+
}
37+
2938
button:hover,
3039
button:focus,
3140
a:hover,
@@ -614,20 +623,21 @@ body .toc {
614623
transform: rotate(90deg);
615624
}
616625

617-
.toc .nav>li>.expand-stub::before,
618-
.toc .nav>li.active>.expand-stub::before {
619-
color: var(--highlight-light);
620-
color: var(--font-color);
621-
display: inline-block;
622-
height: .9rem;
623-
width: 1.2rem;
624-
text-align: center;
625-
overflow: hidden;
626-
content: "›";
627-
font-size: 1.5rem;
628-
line-height: .9rem;
629-
transform: rotate(0deg);
630-
transition: 350ms ease-out;
626+
.toc .nav > li > .expand-stub::before,
627+
.toc .nav > li.active > .expand-stub::before {
628+
color: var(--font-color);
629+
display: inline-block;
630+
height: 2rem;
631+
width: 1.5rem;
632+
line-height: 1.5rem;
633+
text-align: center;
634+
overflow: visible;
635+
content: "›";
636+
font-size: 2rem;
637+
font-weight: bold;
638+
transform: rotate(0deg);
639+
transition: 350ms ease-out;
640+
vertical-align: middle;
631641
}
632642

633643
.toc .nav > li.filtered > ul,
@@ -756,7 +766,7 @@ body .toc {
756766

757767
.toc-filter > input {
758768
color: var(--input-text);
759-
padding-left: 2.3rem;
769+
padding-left: 3rem;
760770
padding-right: 1rem;
761771
width: 100%;
762772
height: calc(1.5em + 8px); /* Adjust height by adding 5 pixels */
@@ -772,11 +782,9 @@ body .toc {
772782
.toc-filter > .filter-icon {
773783
position: absolute;
774784
top: 2px;
775-
left: 5px;
785+
left: 8px;
776786
}
777787

778-
779-
780788
.toc-filter>.clear-icon {
781789
position: absolute;
782790
text-align: center;

RWSTemplate/styles/docfx.js

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -730,26 +730,50 @@ $(function () {
730730
var imgClass = $img.attr('class');
731731
var imgURL = $img.attr('src');
732732

733-
jQuery.get(imgURL, function (data) {
734-
// Get the SVG tag, ignore the rest
735-
var $svg = jQuery(data).find('svg');
733+
jQuery.get(imgURL, function (data) {
734+
// Get the SVG tag, ignore the rest
735+
var $svg = jQuery(data).find('svg');
736736

737-
// Add replaced image's ID to the new SVG
738-
if (typeof imgID !== 'undefined') {
739-
$svg = $svg.attr('id', imgID);
740-
}
741-
// Add replaced image's classes to the new SVG
742-
if (typeof imgClass !== 'undefined') {
743-
$svg = $svg.attr('class', imgClass + ' replaced-svg');
744-
}
737+
// Add replaced image's ID to the new SVG
738+
if (typeof imgID !== 'undefined') {
739+
$svg = $svg.attr('id', imgID);
740+
}
741+
// Add replaced image's classes to the new SVG
742+
if (typeof imgClass !== 'undefined') {
743+
$svg = $svg.attr('class', imgClass + ' replaced-svg');
744+
}
745745

746-
// Remove any invalid XML tags as per http://validator.w3.org
747-
$svg = $svg.removeAttr('xmlns:a');
746+
// Remove any invalid XML tags as per http://validator.w3.org
747+
$svg = $svg.removeAttr('xmlns:a');
748+
749+
// Fix clip-path URLs in styles
750+
$svg.find('[style]').each(function () {
751+
var style = jQuery(this).attr('style');
752+
if (style && style.indexOf('url(#clippath)') !== -1) {
753+
var uniqueId = 'clippath-' + Math.floor(Math.random() * 10000);
754+
// Find <clipPath> element and update id
755+
$svg.find('clipPath#clippath').attr('id', uniqueId);
756+
// Replace url reference to unique id
757+
style = style.replace(/url\(#clippath\)/g, 'url(#' + uniqueId + ')');
758+
jQuery(this).attr('style', style);
759+
}
760+
});
761+
762+
// Also fix clip-path references in attributes (e.g. clip-path="url(#clippath)")
763+
$svg.find('[clip-path]').each(function () {
764+
var cpValue = jQuery(this).attr('clip-path');
765+
if (cpValue && cpValue.indexOf('url(#clippath)') !== -1) {
766+
var uniqueId = 'clippath-' + Math.floor(Math.random() * 10000);
767+
$svg.find('clipPath#clippath').attr('id', uniqueId);
768+
var newValue = cpValue.replace(/url\(#clippath\)/g, 'url(#' + uniqueId + ')');
769+
jQuery(this).attr('clip-path', newValue);
770+
}
771+
});
748772

749-
// Replace image with new SVG
750-
$img.replaceWith($svg);
773+
// Replace image with new SVG
774+
$img.replaceWith($svg);
751775

752-
}, 'xml');
776+
}, 'xml');
753777
});
754778
}
755779

RWSTemplate/styles/main.css

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

0 commit comments

Comments
 (0)