summaryrefslogtreecommitdiff
path: root/www/wiki/skins/chameleon/resources/styles/Components/NavbarHorizontal.less
blob: ab06e51dd50d0c0fd9eda2ce59494846a98af85d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/**
 * Styles for the NavbarHorizontal component
 *
 * This file is part of the MediaWiki skin Chameleon.
 *
 * @copyright 2013 - 2015, Stephan Gambke
 * @license   GNU General Public License, version 3 (or any later version)
 *
 * The Chameleon skin is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option) any
 * later version.
 *
 * The Chameleon skin is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Stephan Gambke
 * @since 1.0
 * @ingroup Skins
 */

// if the navbar is in the first row (i.e. at the top of the page), but inside a
// container (i.e. not a fixed head), add some margin at the top
.navbar {

	z-index: 1;

	.container > *:first-child & {
		margin-top: (@grid-gutter-width / 2);
	}

	.dropdown-menu {

		list-style: outside none none;
		z-index: 1010;

		> li {
			> a {

				display: block;
				padding: 3px 20px;
				clear: both;
				font-weight: normal;
				line-height: @line-height-base;
				color: @dropdown-link-color;
				white-space: nowrap; // prevent links from randomly breaking onto new lines
			}

			&.active, &.selected {
				> a {
					background-color: @navbar-default-link-active-bg;
					font-style: normal;
				}
			}
		}
	}
}

// override some navbar-brand styles to accommodate an image and include a
// separator to the rest of the navbar
.navbar-brand {

	padding: (( @navbar-height - @navbar-logo-height ) / 2 );
	line-height: normal;

	img {
		max-height: @navbar-logo-height;
	}

	@media (min-width: @grid-float-breakpoint) {
		// separator for logo
		border-right: 1px solid @navbar-default-border;
	}

	@media (max-width: @grid-float-breakpoint) {
		float: none
	}
}

.navbar-collapse {
	@media (min-width: @grid-float-breakpoint) {
		padding-left: 0;
		padding-right: 0;
	}
}

.navbar-right-aligned {
	@media (min-width: @grid-float-breakpoint) {

		.pull-right();

		> * {
			float: left;
		}

		.navbar-tools:last-child {
			margin-right: 0 - ( @grid-gutter-width / 2 ) - 1;
			border-right: none;

			li:first-child > a {
				border-top-right-radius: @navbar-border-radius;
			}

			li:last-child > a {
				border-bottom-right-radius: @navbar-border-radius;
			}

		}
	}
}

.navbar-form {
	// Undo 100% width for pull classes
	@media (min-width: @grid-float-breakpoint) {
		// separator for user's personal tools
		border: 0;
		border-left: 1px solid @navbar-default-border;
		border-right: 1px solid @navbar-default-border;

		width: auto;
		padding: ((@navbar-height - @input-height-base) / 2) @navbar-padding-horizontal;
		margin: 0 -1px 0 0;
	}
}

// styles for personal tools in the navbar component
.skin-chameleon .navbar-tools {
	.nav();
	.navbar-nav();

	> li, >li.open {
		> a {

			&.navbar-newtalk-available {
				.link(@navbar-newtalk-available);
			}

			&.navbar-newtalk-not-available {
				.link(@navbar-newtalk-not-available);
			}

			&.navbar-userloggedin {
				.link(@navbar-user-loggedin);
			}

			&.navbar-usernotloggedin {
				.link(@navbar-user-not-loggedin);
			}

		}
	}

	@media (min-width: @grid-float-breakpoint) {

		height: @navbar-height;
		margin: 0 -1px 0 0;

		// separator for user's personal tools
		border-left: 1px solid @navbar-default-border;
		border-right: 1px solid @navbar-default-border;

		> li, li.open {
			float: none;

			height: @navbar-height/2;
			min-width: 2 * @navbar-height/3;
			text-align: center;

			border-color: @navbar-default-border;
			border-bottom: 1px solid @navbar-default-border;

			&:last-child {
				border: none;
			}

			> a, > a:hover, > a:focus {

				height: 100%;
				padding: 0;

				overflow: hidden;

				> * {
					padding: @navbar-padding-vertical/2 @navbar-padding-vertical/2;
					display: inline-block;
					line-height: @line-height-computed/2;
				}

				> img {
					top: 50%;
					left: 50%;
					position: absolute;
					.translate(-50%; -50%);

					padding: 0;
					min-height: 101%;
					min-width: 101%;

					&:hover, &:focus {
						opacity: .7;
					}
				}
			}

			&:first-child:last-child {

				height: @navbar-height;

				> a, > a:hover, > a:focus {
					> * {
						line-height: @line-height-computed;
						padding: @navbar-padding-vertical @navbar-padding-vertical/2;
					}
				}
			}

			&:last-child > ul.dropdown-menu {
				top: @navbar-height / 2 - 1;
			}

			&:first-child > ul.dropdown-menu {
				top: @navbar-height;
			}

		}
	}

	@media (max-width: @grid-float-breakpoint) {
		> li {
			float: left;
		}
	}
}