-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* only show on hover * move to the right on small screens
- Loading branch information
Showing
4 changed files
with
46 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Anchors are by default on the right | ||
// but if there's enough space they get moved to the left | ||
// and hang off into the empty space. | ||
|
||
@mixin has-anchor { | ||
.anchor { | ||
position: absolute; | ||
transition: opacity 125ms; | ||
opacity: .5; | ||
|
||
&:is(:hover, :focus) { opacity: 1; } | ||
&:hover { text-decoration: none; } | ||
} | ||
|
||
@media (hover: hover) { | ||
&:not(:is(:focus-within, :hover)) .anchor { opacity: 0; } | ||
} | ||
} | ||
|
||
@mixin has-anchor-right { | ||
&:has(.anchor) { | ||
padding-right: 1.5ch; | ||
} | ||
|
||
.anchor { | ||
right: 0; | ||
} | ||
} | ||
|
||
@mixin has-anchor-left { | ||
&:has(.anchor) { | ||
padding-left: 1.5ch; | ||
margin-left: -1.5ch; | ||
} | ||
|
||
.anchor { | ||
left: 0; | ||
right: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters