Skip to content

Commit c74b5b2

Browse files
authored
Merge pull request #444 from datacamp/dandenney/add-promo-banner
feat(promo): add banner
2 parents 777245c + 5cc6257 commit c74b5b2

File tree

3 files changed

+60
-52
lines changed

3 files changed

+60
-52
lines changed

assets/styles/pages/_shared.scss

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,19 @@
1111
top: 30px;
1212
left: 0;
1313
right: 0;
14-
position: fixed;
14+
position: static; /* TODO: Remove after promo? */
1515
overflow-y: scroll;
1616
}
1717

18-
1918
.stats {
2019
dd a {
21-
margin-right: $default-space / 3.0;
20+
margin-right: $default-space / 3;
2221
&:last-child {
2322
margin-right: 0;
2423
}
2524
}
2625
}
2726

28-
2927
.no-padding {
3028
padding: 0;
3129
}
@@ -44,19 +42,24 @@
4442
right: 0;
4543
width: 70%;
4644
height: 1.5rem;
47-
background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 50%);
45+
background: linear-gradient(
46+
to right,
47+
rgba(255, 255, 255, 0),
48+
rgba(255, 255, 255, 1) 50%
49+
);
4850
}
4951

50-
.downloads, .percentile-widget {
52+
.downloads,
53+
.percentile-widget {
5154
visibility: hidden;
5255
vertical-align: middle;
5356
margin-left: 0.2rem;
5457
display: inline-block;
55-
p{
58+
p {
5659
-webkit-margin-before: -0.7em;
5760
-webkit-margin-after: 0em;
5861
}
59-
i{
62+
i {
6063
font-size: 1.4rem;
6164
margin-left: 0.6rem;
6265
}
@@ -66,7 +69,8 @@
6669
visibility: hidden;
6770
}
6871

69-
.downloads-nr, .percentile-th {
72+
.downloads-nr,
73+
.percentile-th {
7074
display: flex;
7175
align-items: center;
7276
span:first-child {
@@ -92,6 +96,6 @@
9296
input {
9397
width: 300px;
9498
padding: 0.375em 0.75em;
95-
margin: $default-space auto $default-space / 2.0 auto;
99+
margin: $default-space auto $default-space / 2 auto;
96100
}
97101
}

assets/styles/styleguide/partials/_navbar.scss

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,31 @@
1212

1313
.navbar-color {
1414
background-color: $primary;
15-
background-image: linear-gradient(transparent 90%, rgba(0,0,0,0.01)),linear-gradient(173deg, #3AAACA, #2389B1);
15+
background-image: linear-gradient(transparent 90%, rgba(0, 0, 0, 0.01)),
16+
linear-gradient(173deg, #3aaaca, #2389b1);
1617
color: $text-invert;
1718

1819
.navbar--title .logo-title {
1920
color: $text-invert;
20-
&:hover, &:focus {color: $text-invert }
21+
&:hover,
22+
&:focus {
23+
color: $text-invert;
24+
}
2125
}
2226

2327
.navbar--navigation .link {
24-
color: white;
25-
border-bottom-color: white;
26-
&:focus,
27-
&:hover {
28-
color: inherit;
29-
}
28+
color: white;
29+
border-bottom-color: white;
30+
&:focus,
31+
&:hover {
32+
color: inherit;
33+
}
3034
}
31-
3235
}
3336

3437
.navbar-fixed-top {
3538
top: 0;
36-
position: fixed;
39+
position: static; /* TODO: Remove after promo? */
3740
right: 0;
3841
left: 0;
3942
z-index: 1030;
@@ -54,25 +57,25 @@
5457
border-bottom: none;
5558
margin-left: 1rem;
5659
}
57-
a:focus{
60+
a:focus {
5861
border-bottom: none;
5962
}
6063
.logo {
61-
background: url("../images/logo.png") no-repeat center center;
62-
background-size: contain;
63-
width: 17px;
64-
vertical-align: middle;
65-
display: table-cell;
66-
position:relative;
67-
top: -1px;
64+
background: url("../images/logo.png") no-repeat center center;
65+
background-size: contain;
66+
width: 17px;
67+
vertical-align: middle;
68+
display: table-cell;
69+
position: relative;
70+
top: -1px;
6871
}
6972
.github {
70-
background: url("../images/GitHub-Mark-32px.png") no-repeat center center;
71-
display: inline-block;
72-
background-size: contain;
73-
height: 21px;
74-
width: 21px;
75-
vertical-align: middle;
73+
background: url("../images/GitHub-Mark-32px.png") no-repeat center center;
74+
display: inline-block;
75+
background-size: contain;
76+
height: 21px;
77+
width: 21px;
78+
vertical-align: middle;
7679
}
7780

7881
.logo-title {
@@ -92,50 +95,49 @@ $navbar-search-results-width: 32%px;
9295
transform: translateX(-50%);
9396

9497
input {
95-
padding: 0.1rem 0.5rem;
96-
border: 1px solid $primary;
98+
padding: 0.1rem 0.5rem;
99+
border: 1px solid $primary;
97100
}
98101

99102
.search .results {
100-
width: $navbar-search-results-width;
101-
left: ($navbar-search-width - $navbar-search-results-width) / 2.0;
103+
width: $navbar-search-results-width;
104+
left: ($navbar-search-width - $navbar-search-results-width) / 2;
102105
}
103106
}
104-
button.rstudio-navbutton{
105-
padding:5px;
106-
padding-bottom:0px;
107-
background-color: transparent;
108-
color: $primary;
107+
button.rstudio-navbutton {
108+
padding: 5px;
109+
padding-bottom: 0px;
110+
background-color: transparent;
111+
color: $primary;
109112
}
110113

111-
@media (max-width: 670px){
112-
.navbar--navigation.largescreen{
114+
@media (max-width: 670px) {
115+
.navbar--navigation.largescreen {
113116
display: none;
114117
}
115-
.navbar--title.largescreen{
118+
.navbar--title.largescreen {
116119
display: none;
117120
}
118-
.logo-title.largescreen{
121+
.logo-title.largescreen {
119122
display: none;
120123
}
121-
.navbar--search{
124+
.navbar--search {
122125
width: 50%;
123126
transform: translateX(0%);
124127
left: 47%;
125128
}
126129
}
127-
@media (max-width: 402px){
128-
.navbar--title .logo-title{
130+
@media (max-width: 402px) {
131+
.navbar--title .logo-title {
129132
display: none;
130133
}
131-
.navbar--search{
134+
.navbar--search {
132135
width: 70%;
133136
transform: translateX(0%);
134137
left: 28%;
135138
}
136139
}
137140

138-
139141
.navbar--navigation {
140142
@extend ul.inline;
141143
display: inline-block;

views/layout.ejs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,7 @@
129129
ga('create', 'UA-41577880-1', 'rdocumentation.org');
130130
ga('send', 'pageview');
131131
</script>
132+
133+
<script async src="https://promo.datacamp.com/banner.js" />
132134
</body>
133135
</html>

0 commit comments

Comments
 (0)