From de1a789e9d39fc7951e1accd1c90137d3707fc5b Mon Sep 17 00:00:00 2001 From: Phil Webb Date: Thu, 16 May 2024 06:51:19 -0700 Subject: [PATCH] feat: Visual indicator for External link in the sidebar Resolves #240 --- gulp.d/tasks/generate-octicons.js | 1 + preview-src/ui-model.yml | 4 +++ src/css/nav.css | 10 ++++++++ src/img/octicons-16.svg | 42 ++++++++++++++++++------------- 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/gulp.d/tasks/generate-octicons.js b/gulp.d/tasks/generate-octicons.js index de19fce..dbd48af 100644 --- a/gulp.d/tasks/generate-octicons.js +++ b/gulp.d/tasks/generate-octicons.js @@ -16,6 +16,7 @@ const icons = [ 'info', 'law', 'light-bulb', + 'link-external', 'moon', 'question', 'rocket', diff --git a/preview-src/ui-model.yml b/preview-src/ui-model.yml index f036673..4906a0b 100644 --- a/preview-src/ui-model.yml +++ b/preview-src/ui-model.yml @@ -104,6 +104,10 @@ shared: url: '/samples/edge-cases/index.html' - content: 404 url: '/404.html' + - content: External Link + url: 'https://spring.io' + roles: 'link-external' + target: '_blank' baz: 1.0.0: home: true diff --git a/src/css/nav.css b/src/css/nav.css index 640a1e6..da0c6d8 100644 --- a/src/css/nav.css +++ b/src/css/nav.css @@ -80,6 +80,16 @@ html.is-clipped--nav { margin: 0 0 0 0.75rem; } +.nav-list a.link-external::after { + content: url(../img/octicons-16.svg#view-link-external); + width: 16px; + height: 16px; + display: inline-block; + vertical-align: middle; + margin: 0 0 2px 5px; + filter: opacity(0.5); +} + .nav-menu > .nav-list + .nav-list { margin-top: 0.5rem; } diff --git a/src/img/octicons-16.svg b/src/img/octicons-16.svg index b58752f..1c7cad3 100644 --- a/src/img/octicons-16.svg +++ b/src/img/octicons-16.svg @@ -92,58 +92,64 @@ + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + \ No newline at end of file