Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link styles: follow recommended practice and underline by default #1815

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,19 @@ For the full list of changes, see the [0.9.0] release notes.
[path_base_for_github_subdir]. Projects will need to adjust the value of
[path_base_for_github_subdir] to be relative to the file's physical location.

**New**:
- Docsy statically generates anchor-links after headings using Hugo's
[render-heading.html](https://gohugo.io/templates/render-hooks/) hook. This is
potentially a breaking change for projects that override the hook.

**Other changes**:

- Docsy follows recommended accessibility practice: page-body links are
underlined. For details, see [#1814] and [#1815].

[0.9.0]: https://github.com/google/docsy/releases/latest?FIXME=v0.9.0
[#1744]: https://github.com/google/docsy/pull/1744
[#1814]: https://github.com/google/docsy/issues/1814
[#1815]: https://github.com/google/docsy/pull/1815
[multi-language]: https://www.docsy.dev/docs/language/
[path_base_for_github_subdir]:
https://www.docsy.dev/docs/adding-content/repository-links/#path_base_for_github_subdir-optional
Expand Down
6 changes: 4 additions & 2 deletions assets/scss/_sidebar-toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Right side toc
//
.td-sidebar-toc {
@include link-decoration;

border-left: 1px solid $border-color;

@supports (position: sticky) {
Expand Down Expand Up @@ -48,9 +50,9 @@
a {
color: $gray-600;

&:focus,
&:hover {
color: $blue;
text-decoration: none;
color: initial;
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions assets/scss/_sidebar-tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
}

a {
&:focus,
&:hover {
color: $blue;
text-decoration: none;
color: $link-color;
}

&.active {
Expand Down Expand Up @@ -120,6 +120,8 @@
}

.td-sidebar {
@include link-decoration;

@include media-breakpoint-up(md) {
padding-top: 4rem;
background-color: $td-sidebar-bg-color;
Expand Down
1 change: 0 additions & 1 deletion assets/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ $td-box-colors: $dark, $primary, $secondary, $info, $white, $gray-600, $success,
$warning, $dark, $danger, $primary, $secondary, $info !default;

$link-color: $blue-500 !default;
$link-decoration: none !default;
$link-shade-percentage: 30% !default;

// Fonts
Expand Down
11 changes: 11 additions & 0 deletions assets/scss/support/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
// Mixins

@mixin link-decoration($base: none, $focus_or_hover: initial) {
a {
text-decoration: $base;

&:focus,
&:hover {
text-decoration: $focus_or_hover;
}
}
}

@mixin link-variant($parent, $color, $hover-color, $underline: false) {
#{$parent} {
color: $color;
Expand Down