0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

Correct styling of checkboxes in the post settings menu

This commit is contained in:
Paul Adam Davis 2014-06-20 14:46:04 +01:00
parent 86791afd8b
commit fe6e6c8751
3 changed files with 55 additions and 22 deletions

View file

@ -5,6 +5,7 @@
* *
* Dropdowns * Dropdowns
* Menu * Menu
* Menu Positioning Options
* Post Settings * Post Settings
*/ */
@ -23,7 +24,8 @@
color: $darkgrey; color: $darkgrey;
@include icon-after($i-chevron-down, 8px); @include icon-after($i-chevron-down, 8px);
} }
}
} // .dropdown
/* ========================================================================== /* ==========================================================================
@ -58,7 +60,7 @@
border-color: $darkgrey transparent; border-color: $darkgrey transparent;
display: block; display: block;
width: 0; width: 0;
} } // &:before
// Stop :hover shadow from overflowing // Stop :hover shadow from overflowing
li { li {
@ -78,7 +80,7 @@
background: $blue; background: $blue;
box-shadow: rgba(255,255,255,0.2) 0 1px 0 inset; box-shadow: rgba(255,255,255,0.2) 0 1px 0 inset;
} }
} } // a, p
// Add a check mark to the currently active menu item // Add a check mark to the currently active menu item
.active a { .active a {
@ -89,7 +91,14 @@
} }
} }
} } // .menu
/* ==========================================================================
Menu Positioning Options
---
Combine above classes into one usable class
========================================================================== */
// This extend moves the chiclet to the top, for menus which drop down. // This extend moves the chiclet to the top, for menus which drop down.
.menu-drop { .menu-drop {
@ -137,6 +146,8 @@
/* ========================================================================== /* ==========================================================================
Post Settings Post Settings
---
There classes are used on conjunction with the above classes
========================================================================== */ ========================================================================== */
.post-settings { .post-settings {
@ -153,7 +164,7 @@
&.active { &.active {
color: $darkgrey; color: $darkgrey;
} }
} } // .post-settings
.post-settings-menu { .post-settings-menu {
padding-top: 0; padding-top: 0;
@ -203,7 +214,7 @@
border: none; border: none;
} }
} }
} } // input
.post-setting-item { .post-setting-item {
padding: 5px 0 0 10px; padding: 5px 0 0 10px;
@ -212,10 +223,24 @@
.checkbox { .checkbox {
position: relative; position: relative;
margin-top: 0; margin-top: 0;
width: 18px; top: 0; // Resets a global `form label` style
border: lighten($grey, 10%) 1px solid; border: 0;
background: $grey; &:after {
} border-color: lighten($grey, 10%);
background: $grey;
}
} // .checkbox
// Colour the checkbox border correctly for a dark background
input[type='checkbox'] {
&:focus {
& + .checkbox {
&:after {
border-color: lighten($grey, 10%);
}
}
}
} // input[type='checkbox']
.delete { .delete {
display: block; display: block;
@ -227,6 +252,9 @@
margin-right: 10px margin-right: 10px
}; };
&:hover { background: $red; } &:hover {
} background: $red;
} }
} // .delete
} // .post-settings-menu

View file

@ -191,7 +191,7 @@ input[type="checkbox"] {
position: relative; position: relative;
width: auto; width: auto;
// Create a checkmark, hidden by default // Create a tick, hidden by default
&:before { &:before {
content: ''; content: '';
position: absolute; position: absolute;
@ -208,7 +208,7 @@ input[type="checkbox"] {
// The background for the faux checkbox // The background for the faux checkbox
&:after { &:after {
content: ""; content: '';
display: inline-block; display: inline-block;
width: 18px; width: 18px;
height: 18px; height: 18px;
@ -228,7 +228,7 @@ input[type="checkbox"] {
} }
} }
// If the checkbox is checked, show :before and :after elements correctly // Colour the checkbox correctly when checked
input[type='checkbox'] { input[type='checkbox'] {
&:checked + .checkbox { &:checked + .checkbox {
&:after { &:after {
@ -236,24 +236,29 @@ input[type='checkbox'] {
border-color: lighten($green, 10%); border-color: lighten($green, 10%);
} }
} }
} }
input[type='checkbox'] { input[type='checkbox'] {
// When checkbox is checked, show the tick
&:checked + .checkbox:before { &:checked + .checkbox:before {
opacity: 1; opacity: 1;
} }
&:focus { &:focus {
& + .checkbox { & + .checkbox {
&:after { &:after {
border: $brown 1px solid; border: $brown 1px solid;
} }
} }
} } // &:focus
&:active { &:active {
& + .checkbox { & + .checkbox {
&:after { &:after {
background: $lightbrown; background: $lightbrown;
} }
} }
} } // &:active
}
} // input[type='checkbox']

File diff suppressed because one or more lines are too long