summaryrefslogtreecommitdiff
path: root/lib/tpl/dokuwiki/css/pagetools.less
blob: 77d2670a647ef3debeeb54bde6cb138c5f1303e1 (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
/**
 * This file provides the styles for the page tools
 * (fly out navigation beside the page to edit, etc).
 *
 * @author Anika Henke <anika@selfthinker.org>
 * @author Andreas Gohr <andi@splitbrain.org>
 */

#dokuwiki__site > .site {
    /* give space to the right so the tools won't disappear on smaller screens */
    /* it's 40px because the 30px wide icons will have 5px more spacing to the left and right */
    padding-right: 40px;
    /* give the same space to the left to balance it out */
    padding-left: 40px;
}
.dokuwiki div.page {
    height: 190px;
    min-height: 190px; /* 30 (= height of icons) x 6 (= maximum number of possible tools) + 2x5 */
    height: auto;
}
#dokuwiki__usertools {
    /* move the tools just outside of the site */
    right: 40px;
}
[dir=rtl] #dokuwiki__usertools {
    right: auto;
    left: 40px;
}


#dokuwiki__pagetools {
    position: absolute;
    right: -40px;
    /* on same vertical level as first headline, because .page has 2em padding */
    top: 2em;
    width: 40px;
}
[dir=rtl] #dokuwiki__pagetools {
    right: auto;
    left: -40px;
}

#dokuwiki__pagetools div.tools {
    position: fixed;
    width: 40px;
}

#dokuwiki__pagetools ul {
    position: absolute;
    right: 0;
    text-align: right;
    margin: 0;
    padding: 0;
    /* add transparent border to prevent jumping when proper border is added on hover */
    border: 1px solid transparent;
    z-index: 10;
}
[dir=rtl] #dokuwiki__pagetools ul {
    right: auto;
    left: 0;
    text-align: left;
}

#dokuwiki__pagetools ul li {
    padding: 0;
    margin: 0;
    list-style: none;
    font-size: 0.875em;
}

#dokuwiki__pagetools ul li a {
    display: block;
    min-height: 20px; /* 30 - 2x5 */
    line-height: 20px;
    padding: 0;
    background-position: right 0;
    background-repeat: no-repeat;
    /* add transparent border to prevent jumping when proper border is added on focus */
    border: 1px solid transparent;
    white-space: nowrap;
    width: 30px;
    height: 30px;
    overflow: hidden;
    margin-left: auto; /* align right if the ul is larger because one item is focused */
}

#dokuwiki__pagetools ul li a:before {
    content: url(images/pagetools-sprite.png?v=2);
    display: inline-block;
    font-size: 0;
    line-height: 0;
}

[dir=rtl] #dokuwiki__pagetools ul li a {
    background-position: left 0;
    margin-right: auto;
    margin-left: 0;
}

/* show all tools on hover and individual tools on focus */
#dokuwiki__pagetools:hover ul,
#dokuwiki__pagetools ul li a:focus,
#dokuwiki__pagetools ul li a:active {
    background-color: @ini_background;
    border-color: @ini_border;
    border-radius: 2px;
    box-shadow: 2px 2px 2px @ini_text_alt;
}

#dokuwiki__pagetools:hover ul li a,
#dokuwiki__pagetools ul li a:focus,
#dokuwiki__pagetools ul li a:active {
    width: auto;
    height: auto;
    overflow: visible;
    padding: 5px 40px 5px 5px;
    background-image: url(images/pagetools-sprite.png?v=2);
}

#dokuwiki__pagetools:hover ul li a:before,
#dokuwiki__pagetools ul li a:focus:before {
    content: none;
}

[dir=rtl] #dokuwiki__pagetools:hover ul,
[dir=rtl] #dokuwiki__pagetools ul li a:focus {
    box-shadow: -2px 2px 2px @ini_text_alt;
}

[dir=rtl] #dokuwiki__pagetools:hover li a,
[dir=rtl] #dokuwiki__pagetools ul li a:focus,
[dir=rtl] #dokuwiki__pagetools ul li a:active {
    padding: 5px 5px 5px 40px;
}

/* IE7 fixes, doesn't work without images */

#IE7 #dokuwiki__pagetools ul li a {
    background-image: url(images/pagetools-sprite.png?v=2);
}

#IE7 #dokuwiki__pagetools:hover ul li a span,
#IE7 #dokuwiki__pagetools ul li a:focus span,
#IE7 #dokuwiki__pagetools ul li a:active span {
    clip: auto;
    display: inline;
    position: static;
}

#IE7 #dokuwiki__pagetools ul li a span {
    clip: rect(0 0 0 0);
    position: absolute;
}

#dokuwiki__pagetools ul li a:hover,
#dokuwiki__pagetools ul li a:active,
#dokuwiki__pagetools ul li a:focus {
    text-decoration: none;
}
#dokuwiki__pagetools ul li a:hover {
    background-color: @ini_background_alt;
}

/*____________ all available icons in sprite ____________*/

@pagetools_icon_space: -90px;

/**
 * page tools without highlighting
 *
 * @param string @action The action class
 * @param int @position Position in the page tools sprite
 */
.pagetools-item(@action, @position) {
    @position-active: (@position+0.5);

    #dokuwiki__pagetools ul li a.@{action} {
        background-position: right @pagetools_icon_space * @position;

        &:before {
            margin-top: @pagetools_icon_space * @position;
        }
        &:hover,
        &:active,
        &:focus {
            background-position: right @pagetools_icon_space * @position-active;
        }
    }
    [dir=rtl] #dokuwiki__pagetools ul li a.@{action} {
        background-position: left @pagetools_icon_space * @position;

        &:hover,
        &:active,
        &:focus {
            background-position: left @pagetools_icon_space * @position-active;
        }
    }
}

/**
 * page tools with highlighting
 *
 * @param string @action The action class
 * @param int @position Position in the page tools sprite
 * @param string @mode The mode in which this tool should be highlighted
 */
.pagetools-item(@action, @position, @mode) {
  .pagetools-item(@action, @position);
  @position-active: (@position+0.5);

  .mode_@{mode} #dokuwiki__pagetools ul li a.@{action} {
    background-position: right @pagetools_icon_space * @position-active;
    &:before {
      margin-top: @pagetools_icon_space * @position-active;
    }
  }
  [dir=rtl] .mode_@{mode} #dokuwiki__pagetools ul li a.@{action} {
    background-position: left @pagetools_icon_space * @position-active;
  }
}

.pagetools-item(edit, 1);
.pagetools-item(create, 2);
.pagetools-item(show, 4);
.pagetools-item(source, 5);
.pagetools-item(draft, 3);
.pagetools-item(revs, 7, revisions);
.pagetools-item(backlink, 8, backlink);
.pagetools-item(top, 10);
.pagetools-item(revert, 6, revert);
.pagetools-item(subscribe, 9, subscribe);
.pagetools-item(mediaManager, 11);
.pagetools-item(back, 12);
.pagetools-item(img_backto, 12);