Skip to content

Commit

Permalink
#6: Styling and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
robinpoort committed Jan 4, 2017
1 parent cbd98bf commit 21cd0ed
Show file tree
Hide file tree
Showing 21 changed files with 484 additions and 377 deletions.
41 changes: 35 additions & 6 deletions src/scss/admin/molecules/_tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,36 @@ Styleguide 2.26

.jqtree-element {
padding: 0 $k-spacing-tiny 0 $k-spacing;
overflow: hidden;

@include rtl {
padding: 0 $k-spacing 0 $k-spacing-tiny;
}

&:after {
display: block;
content: " ";
z-index: 0;
border-top: 100px solid;
position: absolute;
top: -20px;
left: 0;
width: 100%;
opacity: 0;
pointer-events: none;
}

&:hover,
&:focus {
background: $k-jqtree-hover-background;
&:after {
border-color: $k-jqtree-hover-background;
opacity: 1;
}
}

.jqtree_common {
position: relative;
z-index: 1;
}
}

Expand All @@ -62,13 +84,19 @@ Styleguide 2.26

.jqtree-selected {
& > .jqtree-element {
background: $k-color-accent;
color: $k-color-accent-type;

&:after {
border-color: $k-color-accent;
opacity: 1;
}
}

&:hover {
& > .jqtree-element {
background: dark($k-color-accent);
&:after {
border-color: dark($k-color-accent);
}
}
}
}
Expand Down Expand Up @@ -168,15 +196,16 @@ Styleguide 2.26
@include psuedo(after) {
width: 6px;
height: 6px;
border-left: 1px solid #aaa;
border-bottom: 1px solid #aaa;
border-left: 1px solid;
border-bottom: 1px solid;
top: 50%;
margin-top: -3px;
left: -(($k-tree-size / 2) + 3px);
opacity: 0.333;

@include rtl {
border-left: none;
border-right: 1px solid #aaa;
border-right: 1px solid;
left: auto;
right: -(($k-tree-size / 2) + 3px);
}
Expand Down
13 changes: 8 additions & 5 deletions src/scss/site-ui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,26 @@ $k-icon-path: '../../koowa/com_koowa/fonts';

@import "site/molecules/alert";
@import "site/molecules/card";
@import "site/molecules/element-queries";
@import "site/molecules/filters";
@import "site/molecules/dropdown-toggle";
@import "site/molecules/element-querie";
@import "site/molecules/flag-object";
@import "site/molecules/forms";
@import "site/molecules/gallery";
@import "site/molecules/inline-list";
@import "site/molecules/input-group";
@import "site/molecules/label";
@import "site/molecules/list";
@import "site/molecules/list-group";
@import "site/molecules/list-item";
@import "site/molecules/media";
@import "site/molecules/nav";
@import "site/molecules/tab";
@import "site/molecules/responsive-embed";
@import "site/molecules/section";
@import "site/molecules/subtitle";
@import "site/molecules/tables";
@import "site/molecules/tags";
@import "site/molecules/table";
@import "site/molecules/title";
@import "site/molecules/toolbar";
@import "site/molecules/tree";


/* Utilities */
Expand Down
14 changes: 0 additions & 14 deletions src/scss/site/_shame.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.k-section {
@include clearfix;
@include content-block($section-spacing);
}

.k-thumbnail {
width: 33%;
max-width: 240px;
Expand Down Expand Up @@ -42,12 +37,3 @@
.k-subtitle + .k-manage {
margin-top: -($section-spacing / 2);
}


.k-list-item {
@include clearfix;
background-image: linear-gradient(top,rgba(0,0,0,.05),transparent);
padding: 15px;
border-top: 1px solid rgba(255,255,255,.1);
border-bottom: 1px solid rgba(0,0,0,.05);
}
13 changes: 12 additions & 1 deletion src/scss/site/atoms/_legend.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
/* Legend
========================================================================== */

/**
* Admin legend overrides
*
* Use RGBA to fit template style
*/

legend {
margin-bottom: 1em;
@include content-block(1em);
color: inherit;
border-bottom-color: rgba(0,0,0,0.1);

&:first-child {
padding-top: 0;
Expand Down
12 changes: 5 additions & 7 deletions src/scss/site/molecules/_alert.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/**
* Alerts
*/
/* Alerts
========================================================================== */

.k-alert {
padding: $alert-padding;
margin-bottom: $spacer-y;
border: $alert-border-width solid transparent;
@include border-radius($alert-border-radius);
border-radius: $alert-border-radius;
}


Expand All @@ -29,6 +28,7 @@

.k-alert-link {
font-weight: $alert-link-font-weight;
color: inherit;
}


Expand All @@ -54,9 +54,7 @@


/**
* Alert styles
*
* Generate contextual modifier classes for colorizing the alert.
* Alternate styles
*/

.k-alert--success {
Expand Down
2 changes: 2 additions & 0 deletions src/scss/site/molecules/_card.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* Admin card overrides
*
* Use RGBA to fit template style
*/

.k-card__body {
Expand Down
195 changes: 195 additions & 0 deletions src/scss/site/molecules/_dropdown-toggle.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
/**
* CSS only dropdown
*
* Best to use with the card molecule to separate label from content
*/

.k-checkbox-dropdown-toggle-container {
@include content-block($section-spacing);
overflow: hidden;


/**
* Override for search styling
*/

input[type="search"] {
box-sizing: border-box;
height: 34px;
}


/**
* By default hide the filter toggle
*/

.k-checkbox-dropdown-toggle,
.k-checkbox-dropdown-label {
display: none;
}


/**
* Accessible hide the toggle box
*/

.k-checkbox-dropdown-toggle {
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;

@include rtl {
left: auto;
right: -10000px;
}
}


/**
* Label
*/

.k-checkbox-dropdown-label {
position: relative;
margin: 0;
padding: 8px 25px;
font-weight: inherit;

&:focus,
&:hover {
text-decoration: underline;
cursor: pointer;


/* Highlight arrow and close button on hover */

&:before,
&:after {
opacity: 1;
}
}


/**
* The toggle arrow
*/

&:before {
display: block;
content: " ";
border-top: 5px solid;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
position: absolute;
top: 1.1em;
left: 0.5em;
margin: 0;
transition: transform 0.3s ease-in-out;
opacity: 0.6;
transform: rotate(-90deg);
backface-visibility: hidden;

@include rtl {
left: auto;
right: 0.5em;
transform: rotate(90deg);
}
}


/**
* The close button
*/

&:after {
display: block;
font-family: sans-serif;
content: "";
font-size: 16px;
line-height: 16px;
position: absolute;
top: 0.35em;
right: 0.35em;
margin: 8px;
transition: all 0.3s ease-in-out;
transform: translate(0, -50px);
opacity: 0.6;

@include rtl {
right: auto;
left: 0.2em;
}
}
}


/**
* For non ancient browsers display the inout and label again
*/

&:not(ancient) {
.k-checkbox-dropdown-toggle,
.k-checkbox-dropdown-label {
display: block;
}
}


/**
* Hide the toggleable content by setting max-height to 0 and make sure it's transitionable
*/

.k-checkbox-dropdown-content:not(ancient) {
overflow: hidden;
max-height: 0;
opacity: 0;
transition: opacity 0.3s ease-out;
}


/**
* Remove styling when unchecked
*/

.k-checkbox-dropdown-toggle:not(:checked) {
& ~ * .k-checkbox-dropdown-content,
& ~ .k-checkbox-dropdown-content {
@include reset;
}
}


/**
* Styling when checked
*/

.k-checkbox-dropdown-toggle:checked {

/* Set max-height to slide down smoothly with CSS */

& ~ * .k-checkbox-dropdown-content,
& ~ .k-checkbox-dropdown-content {
max-height: 9999px;
opacity: 1;
}


/* Rotate the toggle arrow */

& ~ * .k-checkbox-dropdown-label:before,
& ~ .k-checkbox-dropdown-label:before {
transform: rotate(0deg);
}


/* Position the close button */

& ~ * .k-checkbox-dropdown-label:after,
& ~ .k-checkbox-dropdown-label:after {
transform: translate(0, 0);
}
}
}
Loading

0 comments on commit 21cd0ed

Please sign in to comment.