Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d0b1c1

Browse files
authored
Merge pull request #8628 from QuLogic/css-fork-ribbon
DOC: Use CSS-based Fork-on-GitHub ribbon.
2 parents fc268e2 + 3d12c60 commit 0d0b1c1

2 files changed

Lines changed: 56 additions & 7 deletions

File tree

doc/_static/mpl.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,58 @@ figcaption {
710710
text-align: center;
711711
}
712712

713+
/* Fork me on GitHub "button" */
714+
#forkongithub a{
715+
background:#FF7F0E;
716+
color:#fff !important;
717+
text-decoration:none;
718+
text-align:center;
719+
font-weight:bold;
720+
padding:5px 40px;
721+
line-height:1.5rem;
722+
position:relative;
723+
transition:background .25s ease;
724+
}
725+
#forkongithub a:hover{
726+
background:#CA7900;
727+
}
728+
#forkongithub a::before,#forkongithub a::after{
729+
content:"";
730+
width:100%;
731+
display:block;
732+
position:absolute;
733+
top:1px;
734+
left:0;
735+
height:1px;
736+
background:#fff;
737+
}
738+
#forkongithub a::after{
739+
bottom:1px;
740+
top:auto;
741+
}
742+
@media screen and (min-width:700px){
743+
#forkongithub{
744+
position:absolute;
745+
top:0;
746+
right:0;
747+
width:150px;
748+
overflow:hidden;
749+
height:150px;
750+
z-index:9999;
751+
}
752+
#forkongithub a{
753+
width:150px;
754+
position:absolute;
755+
top:40px;
756+
right:-60px;
757+
transform:rotate(45deg);
758+
-webkit-transform:rotate(45deg);
759+
-ms-transform:rotate(45deg);
760+
-moz-transform:rotate(45deg);
761+
-o-transform:rotate(45deg);
762+
box-shadow:4px 4px 10px rgba(0,0,0,0.8);
763+
}
764+
}
713765

714766
.donate_button {
715767
background:#11557C;

doc/_templates/layout.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,15 @@ <h3>{{ _('Navigation') }}</h3>
162162

163163
{% block relbar1 %}
164164

165-
<!-- The "Fork me on github" ribbon -->
166-
<img style="float: right; margin-bottom: -40px; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" usemap="#ribbonmap"/>
167-
<map name="ribbonmap">
168-
<area shape="poly" coords="15,0,148,-1,148,135" href="https://github.com/matplotlib/matplotlib" title="Fork me on GitHub" />
169-
</map>
170-
171-
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
165+
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px; position: relative;">
172166
{%- if builder in ('htmlhelp', 'devhelp', 'latex') %}
173167
<a href="{{ pathto('index') }}"><img src="{{pathto("_static/logo2.png", 1) }}" width="540px" border="0" alt="matplotlib"/></a>
174168
{%- else %}
175169
<a href="{{ pathto('index') }}"><img src="{{pathto("_static/logo2.svg", 1) }}" width="540px" border="0" alt="matplotlib"/></a>
176170
{%- endif %}
171+
172+
<!-- The "Fork me on github" ribbon -->
173+
<div id="forkongithub"><a href="https://github.com/matplotlib/matplotlib">Fork me on GitHub</a></div>
177174
</div>
178175

179176
{% endblock %}

0 commit comments

Comments
 (0)