File size: 6,439 Bytes
1e92f2d |
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 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
.sidebar {
// Setting the position and clearing some
// margins and paddings.
margin: 0;
padding: 0;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
flex-direction: column;
overflow: auto;
// Not sure this is needed.
@include breakpoint-deprecated( "<660px" ) {
-webkit-overflow-scrolling: touch;
}
// Prevent elements from shrinking during
// initial load in Safari. Unsure if still required?
.sidebar__footer,
ul,
li {
flex-shrink: 0;
}
// Reset lists to avoid bullets and margins.
ul {
margin: 0;
padding: 0;
}
li {
list-style: none;
}
.count {
margin-left: 8px;
background-color: var(--color-sidebar-menu-hover-background);
border-color: var(--color-sidebar-menu-hover-background);
color: var(--color-sidebar-menu-hover-text);
}
}
// This button is hidden until focused. It allows screen-readers
// and other assistive technology to skip the sidebar.
.sidebar__skip-navigation {
position: absolute;
left: -10000px;
flex-shrink: 0;
&:focus {
position: relative;
left: auto;
}
}
// Sidebar Headings, used for both static headings
// like in Reader, and for the expandable menus.
.sidebar__heading {
color: var(--color-sidebar-text-alternative);
font-size: $font-body;
font-weight: 600;
padding: 16px 8px 6px 16px;
margin: 0;
outline: 0;
}
// Sidebar menu icons for main sections
.sidebar__menu-icon {
fill: var(--color-sidebar-gridicon-fill);
color: var(--color-sidebar-gridicon-fill);
margin-right: 11px;
flex-shrink: 0;
}
// Checklist progress
.sidebar__menu .myhome .sidebar__menu-link-text {
max-width: calc(100% - 80px);
white-space: normal;
padding-right: 8px;
}
.sidebar__checklist-progress {
width: 80px;
.sidebar__checklist-progress-text {
font-size: $font-body-extra-small;
margin: 0;
white-space: normal;
text-overflow: ellipsis;
overflow: hidden;
}
.progress-bar {
background-color: color-mix(in srgb, var(--color-sidebar-text) 40%, transparent);
height: 6px;
.selected & {
background-color: color-mix(in srgb, var(--color-sidebar-menu-selected-text) 40%, transparent);
}
.progress-bar__progress {
background-color: var(--color-sidebar-text);
.selected & {
background-color: var(--color-sidebar-menu-selected-text);
}
}
}
}
// Menu links: The actual anchor tags that contain links to
// various sections of Calypso.
.sidebar__menu-link {
font-size: $font-body;
line-height: 1.2;
position: relative;
padding: 10px 16px 10px 20px;
box-sizing: border-box;
overflow: hidden;
display: flex;
align-items: center;
text-decoration: none;
&,
&:visited {
color: var(--color-sidebar-text);
}
// I think this is some voodoo to change the color
// of a link when tapped on iOS.
-webkit-tap-highlight-color: color-mix(in srgb, var(--color-neutral-700) 20%, transparent);
&:hover {
background-color: var(--color-sidebar-menu-hover-background);
color: var(--color-sidebar-menu-hover-text);
.sidebar__menu-icon {
fill: var(--color-sidebar-menu-hover-text);
}
.count {
border-color: var(--color-sidebar-menu-hover-text);
}
}
&:focus {
outline: none;
}
.badge {
margin: -7px 0 -8px;
}
.sidebar__menu-link-badge {
margin-left: 8px;
color: var(--color-warning-light);
padding: 1px 6px;
font-size: $font-body-extra-small;
}
.selected &,
.selected &:hover {
color: var(--color-sidebar-menu-selected-text);
background-color: var(--color-sidebar-menu-selected-background);
.stats-sparkline {
--color-stats-sparkline: var(--color-sidebar-menu-selected-text);
}
.sidebar__menu-icon {
fill: var(--color-sidebar-menu-selected-text);
}
.count {
background-color: transparent;
border-color: var(--color-sidebar-menu-selected-text);
color: var(--color-sidebar-menu-selected-text);
}
}
// Some links are marked as "external" and show
// an icon to visually indicate they will open
// a new window/tab.
.gridicons-external,
&.external-link .gridicons-external {
height: 16px;
width: 16px;
position: absolute;
right: 21px;
top: auto;
}
}
.sidebar__menu.is-togglable .sidebar__menu-link {
line-height: 1.5;
padding: 7px 16px 7px 20px;
padding-left: 55px;
}
.sidebar__menu-link-text {
flex: auto;
}
.sidebar__menu-link-secondary-text {
margin-right: 8px;
align-self: center;
font-weight: 600;
font-size: $font-body-extra-small;
position: absolute;
right: 0;
z-index: 1;
color: var(--color-sidebar-text-alternative);
padding: 4px 8px;
.selected &,
.sidebar__menu-link:hover & {
color: inherit;
}
}
// Expandables: Some sidebar menus act like accordions where
// you can hide and show the contained list.
.sidebar__menu.is-togglable {
.sidebar__heading {
display: flex;
padding: 10px 16px 10px 20px;
font-weight: 600;
cursor: pointer;
&:hover {
background-color: var(--color-sidebar-menu-hover-background);
color: var(--color-sidebar-menu-hover-text);
.sidebar__menu-icon,
.sidebar__expandable-arrow {
fill: var(--color-sidebar-menu-hover-text);
}
.count {
background-color: transparent;
border-color: var(--color-sidebar-submenu-selected-text);
color: var(--color-sidebar-submenu-selected-text);
}
}
}
.sidebar__expandable-title {
flex: 1 1 0;
}
.sidebar__expandable-arrow {
transition: transform 0.1s linear;
fill: var(--color-sidebar-gridicon-fill);
}
&.is-toggle-open {
.sidebar__expandable-arrow {
transform: rotate(180deg);
}
.count {
background-color: transparent;
border-color: var(--color-sidebar-submenu-selected-text);
color: var(--color-sidebar-submenu-selected-text);
}
}
.sidebar__expandable-button.components-button:focus {
outline: none;
box-shadow: none;
.accessible-focus & {
box-shadow: inset 0 0 0 2px var(--color-primary-light);
}
}
}
// Sometimes we show info at the bottom of the sidebar. For
// example on My Site(s), for users with a single site, we
// show a button to add a new site.
.sidebar__wp-admin,
.sidebar__footer {
margin-top: 16px;
}
.sidebar__menu-wrapper {
border-top: 1px solid var(--color-sidebar-border);
}
.sidebar__menu-link-badge {
display: inline-block;
padding: 1px 6px;
border: solid 1px var(--color-warning);
border-radius: 12px; /* stylelint-disable-line scales/radii */
font-size: $font-body-extra-small;
line-height: 14px;
text-align: center;
color: var(--color-warning-light);
margin-left: 8px;
}
|