[Frontend] Refactoring glyphs to classes

fixes #1047
Very much In-progess, s-btn and
s-btn-menu refactoring
This commit is contained in:
Charles Hacskaylo 2016-06-22 23:15:24 -07:00
parent f574ffed16
commit 8b29ccf3af
8 changed files with 64 additions and 39 deletions

View File

@ -7,3 +7,11 @@
&.mobile-info { @include glyph('\e920'); } &.mobile-info { @include glyph('\e920'); }
&.context-available { @include glyph('\e902'); } &.context-available { @include glyph('\e902'); }
} }
/*************************************** MENUS */
.icon-menu ul li {
&.i-layers-move-to-top { @include glyph('\e905'); }
&.i-layers-move-up { @include glyph('\e909'); }
&.i-layers-move-down { @include glyph('\e902'); }
&.i-layers-move-to-bottom { @include glyph('\e908'); }
}

View File

@ -54,7 +54,7 @@ $pad: $interiorMargin * $baseRatio;
&.key-edit, &.key-edit,
&.key-properties { &.key-properties {
$bg: $colorBtnMajorBg; $bg: $colorBtnMajorBg;
$hc: lighten($bg, 10%); $hc: pullForward($bg, 10%);
@include btnSubtle($bg, $hc, $colorBtnMajorFg, $colorBtnMajorFg); @include btnSubtle($bg, $hc, $colorBtnMajorFg, $colorBtnMajorFg);
} }
@ -115,8 +115,16 @@ $pad: $interiorMargin * $baseRatio;
} }
.s-icon-btn { .s-icon-btn {
@extend .ui-symbol; $c: $colorKey;
// Color and styling additionally in _controls.scss @extend .s-btn;
&:before {
@extend .ui-symbol;
content: '\e901';
color: $colorKey;
}
&:hover:before {
color: pullForward($c, 10%);
}
} }
body.desktop .mini-tab { body.desktop .mini-tab {

View File

@ -539,8 +539,7 @@ textarea {
} }
/******************************************************** MISC */ /******************************************************** MISC */
.context-available, .context-available {
.s-icon-btn {
$c: $colorKey; $c: $colorKey;
color: $c; color: $c;
&:hover { &:hover {

View File

@ -29,7 +29,7 @@
} }
.icon { .icon {
font-size: 120%; font-size: 16px; //120%;
} }
.title-label { .title-label {
@ -86,7 +86,8 @@
li { li {
box-sizing: border-box; box-sizing: border-box;
border-top: 1px solid pullForward($colorMenuBg, 10%); border-top: 1px solid pullForward($colorMenuBg, 10%);
color: pullForward($colorMenuBg, 60%); color: $colorMenuFg;
//color: pullForward($colorMenuBg, 60%);
line-height: $menuLineH; line-height: $menuLineH;
padding: $interiorMarginSm $interiorMargin * 2 $interiorMarginSm ($interiorMargin * 2) + $treeTypeIconW; padding: $interiorMarginSm $interiorMargin * 2 $interiorMarginSm ($interiorMargin * 2) + $treeTypeIconW;
position: relative; position: relative;
@ -97,31 +98,46 @@
&:hover { &:hover {
background: $colorMenuHovBg; background: $colorMenuHovBg;
color: $colorMenuHovFg; color: $colorMenuHovFg;
.icon {
color: $colorMenuHovIc;
}
}
.type-icon {
left: $interiorMargin * 2;
} }
} }
} }
} }
.icon-menu {
@extend .menu;
ul li {
&:hover {
&:before {
color: $colorMenuHovIc;
}
}
&:before {
@extend .ui-symbol;
@extend .type-icon;
@extend .icon;
content: '';
display: inline-block;
left: $interiorMargin * 2;
}
}
}
.menu, .menu,
.icon-menu,
.context-menu, .context-menu,
.super-menu, .super-menu,
.s-menu-btn .menu { .s-menu-btn .menu {
pointer-events: auto; pointer-events: auto;
ul li { ul li {
a { a {
color: $colorMenuFg; // TO-DO: factor this <a> out
color: $colorMenuFg;
display: block; display: block;
} }
.icon { &:before {
color: $colorMenuIc; color: $colorMenuIc;
}
.type-icon {
left: $interiorMargin; left: $interiorMargin;
} }
} }

View File

@ -86,12 +86,12 @@ table {
color: $colorIconLink; color: $colorIconLink;
font-family: symbolsfont; font-family: symbolsfont;
font-size: 8px; font-size: 8px;
content: "\ed"; content: "\e906";
display: inline-block; display: inline-block;
margin-left: $interiorMarginSm; margin-left: $interiorMarginSm;
} }
&.sort.desc:after { &.sort.desc:after {
content: "\ec"; content: "\e907";
} }
} }
&.sortable { &.sortable {
@ -119,19 +119,12 @@ table {
} }
} }
&.filterable { &.filterable {
thead, .thead {
tr.s-filters, .tr.s-filters {
th, .th {
//border-left: none;
}
}
}
tbody, .tbody { tbody, .tbody {
top: $tabularHeaderH * 2; top: $tabularHeaderH * 2;
} }
input[type="text"] { input[type="text"] {
box-sizing: border-box; box-sizing: border-box;
width: 100%; //50px; width: 100%;
} }
} }
@ -202,5 +195,4 @@ table {
} }
} }
} }
} }

View File

@ -110,26 +110,31 @@ define([
{ {
"method": "order", "method": "order",
"glyph": "á", "glyph": "á",
"cssclass": "i-layers",
"control": "menu-button", "control": "menu-button",
"options": [ "options": [
{ {
"name": "Move to Top", "name": "Move to Top",
"glyph": "\u00eb", "glyph": "\u00eb",
"cssclass": "i-layers-move-to-top",
"key": "top" "key": "top"
}, },
{ {
"name": "Move Up", "name": "Move Up",
"glyph": "\u005e", "glyph": "\u005e",
"cssclass": "i-layers-move-up",
"key": "up" "key": "up"
}, },
{ {
"name": "Move Down", "name": "Move Down",
"glyph": "\u0076", "glyph": "\u0076",
"cssclass": "i-layers-move-down",
"key": "down" "key": "down"
}, },
{ {
"name": "Move to Bottom", "name": "Move to Bottom",
"glyph": "\u00ee", "glyph": "\u00ee",
"cssclass": "i-layers-move-to-bottom",
"key": "bottom" "key": "bottom"
} }
] ]

View File

@ -20,7 +20,7 @@
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<a class="s-btn" <a class="s-btn"
ng-class="{ labeled: structure.text }" ng-class="{ labeled: structure.text, structure.cssclass }"
ng-click="structure.click()"> ng-click="structure.click()">
<span class="ui-symbol icon"> <span class="ui-symbol icon">
{{structure.glyph}} {{structure.glyph}}

View File

@ -19,25 +19,22 @@
this source code distribution or the Licensing information page available this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<div class="s-menu-btn menu-element" <div class="s-menu-btn menu-element {{ structure.cssclass }}"
ng-controller="ClickAwayController as toggle"> ng-controller="ClickAwayController as toggle">
<span class="l-click-area" ng-click="toggle.toggle()"></span> <span class="l-click-area" ng-click="toggle.toggle()"></span>
<span class="ui-symbol icon">{{structure.glyph}}</span> <!--<span class="ui-symbol icon">{{structure.glyph}}</span>-->
<span class="title-label" ng-if="structure.text"> <span class="title-label" ng-if="structure.text">
{{structure.text}} {{structure.text}}
</span> </span>
<div class="menu" ng-show="toggle.isActive()"> <div class="menu icon-menu" ng-show="toggle.isActive()">
<ul> <ul>
<li ng-click="structure.click(option.key); toggle.setState(false)" ng-repeat="option in structure.options"> <li ng-click="structure.click(option.key); toggle.setState(false)"
<a href=""> ng-repeat="option in structure.options"
<span class="ui-symbol type-icon icon"> class="{{ option.cssclass }}">
{{option.glyph}}
</span>
{{option.name}} {{option.name}}
</a>
</li> </li>
</ul> </ul>
</div> </div>