Skip to content

Commit

Permalink
add outline control
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesros161 committed Apr 6, 2022
1 parent c81ad6e commit c9213d2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/controls/outline/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,35 @@ export class Outline extends MultiSlider {
units: {
default: 'px',
enabled: [ 'px', 'em' ]
}
},
sliders: [
{ name: 'outline-width', label: 'width', cssProperty: 'outline-width' },
{ name: 'outline-offset', label: 'offset', cssProperty: 'outline-offset' }
]
},
sliderConfig: {
'outline-width': {
min: 0,
max: 15
},
'outline-offset': {
min: -30,
max: 30
},
},
slider: {
px: {
step: 0.1,
min: 0,
max: 15
min: -30,
max: 30
},
em: {
min: 0,
max: 5,
min: -10,
max: 10,
step: 0.1
}
}
};

this.outlineDirections = [ 'left', 'top', 'right', 'bottom' ];
}

/**
Expand Down Expand Up @@ -91,14 +103,7 @@ export class Outline extends MultiSlider {
* @return {string} Currently applied style.
*/
_getOutlineStyle() {
let style = '';
for ( let direction of this.outlineDirections ) {
let directionalStyle = this.$target.css( 'outline-' + direction + '-style' );
if ( 'none' !== directionalStyle && directionalStyle ) {
style = directionalStyle;
break;
}
}
let style = this.$target.css( 'outline-style' );

return style;
}
Expand Down
1 change: 1 addition & 0 deletions src/controls/outline/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
list-style: none;
padding-left: 5px;
font-size: 15px;
text-align: left;

li {
margin: 6px 0;
Expand Down

0 comments on commit c9213d2

Please sign in to comment.