summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-14 15:22:31 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-14 15:22:31 -0800
commit204b3c121cb038c5825dff3fa877ae2eea15403b (patch)
treeb8df6ddf2adb4f78bfbc13122f0be4b3fa919b74
parentff7f4a134e4d62a22a38409b7f71c582d86f53d8 (diff)
downloadgitlab-ce-204b3c121cb038c5825dff3fa877ae2eea15403b.tar.gz
Fix anchor issue with fixed navbar
When use anchors - conetent gets hidden under navbar. This commit fixes with hack using margin+height combination
-rw-r--r--app/assets/stylesheets/generic/timeline.scss11
-rw-r--r--app/assets/stylesheets/generic/typography.scss15
-rw-r--r--app/assets/stylesheets/main/layout.scss1
-rw-r--r--app/assets/stylesheets/main/mixins.scss6
-rw-r--r--app/assets/stylesheets/sections/header.scss2
-rw-r--r--app/assets/stylesheets/sections/notes.scss1
-rw-r--r--app/views/layouts/_head_panel.html.haml2
7 files changed, 30 insertions, 8 deletions
diff --git a/app/assets/stylesheets/generic/timeline.scss b/app/assets/stylesheets/generic/timeline.scss
index 82ee41b71bd..cdd044290da 100644
--- a/app/assets/stylesheets/generic/timeline.scss
+++ b/app/assets/stylesheets/generic/timeline.scss
@@ -20,6 +20,17 @@
margin-bottom: 10px;
clear: both;
+ /* Hack for anchors and fixed navbar */
+ &[id] {
+ &:before {
+ content: '';
+ display: block;
+ position: relative;
+ width: 0;
+ height: 3em;
+ margin-top: -3em;
+ }
+ }
&:target {
.timeline-entry-inner .timeline-content {
diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss
index 385a627b4be..3f63a0b92b1 100644
--- a/app/assets/stylesheets/generic/typography.scss
+++ b/app/assets/stylesheets/generic/typography.scss
@@ -98,8 +98,7 @@ a:focus {
$size: 16px;
position: absolute;
right: 100%;
- top: 50%;
- margin-top: -$size/2;
+ bottom: 7px;
margin-right: 0px;
padding-right: 20px;
display: inline-block;
@@ -109,6 +108,18 @@ a:focus {
background-size: contain;
background-repeat: no-repeat;
}
+
+ /* Hack for anchors and fixed navbar */
+ &[id] {
+ &:before {
+ content: '';
+ display: block;
+ position: relative;
+ width: 0;
+ height: 3em;
+ margin-top: -3em;
+ }
+ }
}
ul {
diff --git a/app/assets/stylesheets/main/layout.scss b/app/assets/stylesheets/main/layout.scss
index 71522443f10..e44bccb0183 100644
--- a/app/assets/stylesheets/main/layout.scss
+++ b/app/assets/stylesheets/main/layout.scss
@@ -12,4 +12,3 @@ html {
.container .content {
margin: 0 0;
}
-
diff --git a/app/assets/stylesheets/main/mixins.scss b/app/assets/stylesheets/main/mixins.scss
index 5f83913b73b..c86f9be52d0 100644
--- a/app/assets/stylesheets/main/mixins.scss
+++ b/app/assets/stylesheets/main/mixins.scss
@@ -65,8 +65,10 @@
max-width: 100%;
}
- *:first-child {
- margin-top: 0;
+ h1, h2, h3 {
+ &:first-child {
+ margin-top: 0;
+ }
}
code { padding: 0 4px; }
diff --git a/app/assets/stylesheets/sections/header.scss b/app/assets/stylesheets/sections/header.scss
index 32b0b10c649..a5098b6da5b 100644
--- a/app/assets/stylesheets/sections/header.scss
+++ b/app/assets/stylesheets/sections/header.scss
@@ -8,8 +8,6 @@ header {
margin-bottom: 0;
min-height: 40px;
border: none;
- position: fixed;
- top: 0;
width: 100%;
.navbar-inner {
diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss
index 1550e30fe53..74945717a02 100644
--- a/app/assets/stylesheets/sections/notes.scss
+++ b/app/assets/stylesheets/sections/notes.scss
@@ -57,6 +57,7 @@ ul.notes {
.note {
display: block;
position:relative;
+
.attachment {
font-size: 14px;
}
diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml
index e98b8ec631d..bdf27562c26 100644
--- a/app/views/layouts/_head_panel.html.haml
+++ b/app/views/layouts/_head_panel.html.haml
@@ -1,4 +1,4 @@
-%header.navbar.navbar-static-top.navbar-gitlab
+%header.navbar.navbar-fixed-top.navbar-gitlab
.navbar-inner
.container
%div.app_logo