Skip to content

Commit 75408eb

Browse files
committed
Menubar and Menu: Cleanup menu styles. Pull out menubar styles from demo into css file.
1 parent 85eeaf0 commit 75408eb

File tree

4 files changed

+27
-66
lines changed

4 files changed

+27
-66
lines changed

demos/menubar/default.html

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<title>jQuery UI Menubar - Default demo</title>
55
<link rel="stylesheet" href="../demos.css" type="text/css" />
6-
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
6+
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" />
77
<script src="../../jquery-1.5.1.js"></script>
88
<script src="../../ui/jquery.ui.core.js"></script>
99
<script src="../../ui/jquery.ui.widget.js"></script>
@@ -21,7 +21,7 @@
2121
$("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
2222
}
2323
});
24-
24+
2525
$(".menubar-icons").menubar({
2626
menuIcon: true,
2727
buttons: true,
@@ -34,39 +34,8 @@
3434
});
3535
});
3636
</script>
37-
<style type="text/css">
38-
#bar1, #bar2 { margin: 0 0 4em; } /* style for this page only */
39-
.ui-menu { width: 200px; position: absolute; outline: none; z-index: 9999; }
40-
.ui-menu .ui-icon { float: right; }
41-
.ui-menu li.ui-state-disabled {
42-
font-weight: bold;
43-
padding: .0em .4em;
44-
margin: .4em 0 .2em;
45-
line-height: 1.5;
46-
}
47-
48-
/* menubar styles */
49-
.ui-menubar .ui-button { float: left; font-weight: normal; border-top-width: 0 !important; border-bottom-width: 0 !important; margin: 0; outline: none; }
50-
.ui-menubar .ui-menubar-link { border-right: 1px dashed transparent; border-left: 1px dashed transparent; }
51-
52-
.ui-menubar {
53-
list-style: none;
54-
margin: 0;
55-
padding-left: 0;
56-
}
57-
58-
.ui-menubar-item {
59-
float: left;
60-
}
61-
/*
62-
table {
63-
border-collapse: collapse;
64-
}
65-
th, td {
66-
padding: 0.5em;
67-
border: 1px solid black;
68-
}
69-
*/
37+
<style>
38+
#bar1, #bar2 { margin: 0 0 4em; }
7039
</style>
7140
</head>
7241
<body>

themes/base/jquery.ui.base.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
@import url("jquery.ui.datepicker.css");
1616
@import url("jquery.ui.dialog.css");
1717
@import url("jquery.ui.menu.css");
18+
@import url("jquery.ui.menubar.css");
1819
@import url("jquery.ui.progressbar.css");
1920
@import url("jquery.ui.resizable.css");
2021
@import url("jquery.ui.selectable.css");

themes/base/jquery.ui.menu.css

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,14 @@
77
*
88
* http://docs.jquery.com/UI/Menu#theming
99
*/
10-
.ui-menu {
11-
list-style:none;
12-
padding: 2px;
13-
margin: 0;
14-
display:block;
15-
outline: none;
16-
}
17-
.ui-menu .ui-menu {
18-
margin-top: -3px;
19-
}
20-
.ui-menu .ui-menu-item {
21-
margin:0;
22-
padding: 0;
23-
zoom: 1;
24-
width: 100%;
25-
}
26-
.ui-menu .ui-menu-item a {
27-
text-decoration:none;
28-
display:block;
29-
padding: 2px .4em;
30-
line-height:1.5;
31-
zoom:1;
32-
font-weight: normal;
33-
}
10+
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
11+
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
12+
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
13+
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
3414
.ui-menu .ui-menu-item a.ui-state-focus,
35-
.ui-menu .ui-menu-item a.ui-state-active {
36-
font-weight: normal;
37-
margin: -1px;
38-
}
15+
.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
3916

40-
/* nested menus */
41-
.ui-menu .ui-menu { position: absolute; }
17+
.ui-menu li.ui-state-disabled { font-weight: normal; padding: .0em .4em; margin: .4em 0 .2em; line-height: 1.5; }
4218

4319
/* icon support */
4420
.ui-menu-icons { position: relative; }
@@ -48,4 +24,4 @@
4824
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
4925

5026
/* right-aligned */
51-
.ui-menu .ui-menu-icon { position: static; float: right; }
27+
.ui-menu .ui-menu-icon { position: static; float: right; }

themes/base/jquery.ui.menubar.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* jQuery UI Menubar @VERSION
3+
*
4+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5+
* Dual licensed under the MIT or GPL Version 2 licenses.
6+
* http://jquery.org/license
7+
*/
8+
.ui-menubar { list-style: none; margin: 0; padding-left: 0; }
9+
10+
.ui-menubar-item { float: left; }
11+
12+
.ui-menubar .ui-button { float: left; font-weight: normal; border-top-width: 0 !important; border-bottom-width: 0 !important; margin: 0; outline: none; }
13+
.ui-menubar .ui-menubar-link { border-right: 1px dashed transparent; border-left: 1px dashed transparent; }
14+
15+
.ui-menubar .ui-menu { width: 200px; position: absolute; z-index: 9999; }

0 commit comments

Comments
 (0)