-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
108 additions
and
42 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import classNames from 'classnames'; | ||
|
||
const SocialLinkSave = ( { attributes } ) => { | ||
const { url, site, label } = attributes; | ||
const classes = classNames( | ||
'wp-social-link', | ||
'wp-social-link-' + site, | ||
{ 'wp-social-link__is-incomplete': ! url }, | ||
); | ||
|
||
return ( | ||
<li className={ classes }> | ||
<a href={ url }> | ||
<em>{ label }</em> | ||
</a> | ||
</li> | ||
); | ||
}; | ||
|
||
export default SocialLinkSave; |
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,79 @@ | ||
|
||
.wp-social-link { | ||
display: block; | ||
width: 36px; | ||
height: 36px; | ||
border-radius: 36px; // This makes it pill-shaped instead of oval, in cases where the image fed is not perfectly sized. | ||
margin-right: 8px; | ||
transition: transform 0.1s ease; | ||
@include reduce-motion("transition"); | ||
|
||
a { | ||
padding: 6px; | ||
display: block; | ||
line-height: 0; | ||
transition: transform 0.1s ease; | ||
} | ||
|
||
a, | ||
a:hover, | ||
a:active, | ||
a:visited, | ||
svg { | ||
color: currentColor; | ||
fill: currentColor; | ||
|
||
// Some themes add underlines, false underlines (via shadows), and borders to <a>. | ||
text-decoration: none; | ||
border-bottom: 0; | ||
box-shadow: none; | ||
} | ||
|
||
&:hover { | ||
transform: scale(1.1); | ||
} | ||
|
||
// We use the inner element as a background for the icon. | ||
em { | ||
display: block; | ||
width: 24px; | ||
height: 24px; | ||
text-indent: 100%; | ||
overflow: hidden; | ||
} | ||
} | ||
|
||
|
||
@mixin sociallink($logo, $color) { | ||
// This is shown to IE11 and older browsers. | ||
background-color: #fff; | ||
box-shadow: 0 0 0 1px #000; | ||
|
||
em { | ||
background: url($logo) no-repeat center center; | ||
} | ||
|
||
@supports (mask-size: cover) or (-webkit-mask-size: cover) { | ||
background-color: $color; | ||
box-shadow: none; | ||
|
||
em { | ||
background: #fff; | ||
-webkit-mask: url($logo) no-repeat center center; | ||
mask: url($logo) no-repeat center center; | ||
-webkit-mask-size: cover; | ||
mask-size: cover; | ||
} | ||
} | ||
} | ||
|
||
.wp-social-link-mastodon { | ||
@include sociallink( "https://cldup.com/a2oE4qAWQz.svg", #3288d4 ); | ||
} | ||
.wp-social-link-twitter { | ||
@include sociallink( "https://cldup.com/JPmc-H2Egd.svg", #21a1f3 ); | ||
} | ||
|
||
.wp-social-link-wordpress { | ||
@include sociallink( "https://cldup.com/w4j97g2E1Y.svg", #3499cd ); | ||
} |
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