Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit c5596f8

Browse files
author
Aaron Imming
committed
Update selectors + use vendor prefixes
1 parent ab533f1 commit c5596f8

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/assets/sass/scratch/_toolbox.scss

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,49 +49,49 @@ $category-colours: (
4949
display: flex;
5050
flex-direction: row;
5151
}
52-
&__cat-arrow {
52+
&__category-arrow {
5353
display: flex;
5454
margin: auto;
5555

5656
&--back {
5757
margin-left: $category-text-spacing;
5858
fill: $white;
59-
transform: rotate(90deg);
59+
@include vendor(transform, rotate(90deg));
6060
}
6161
&--open {
6262
margin-right: $category-text-spacing;
63-
transform: rotate(270deg);
63+
@include vendor(transform, rotate(270deg));
6464
}
6565
}
66-
&__cat-colour {
66+
&__category-colour {
6767
width: 5px;
6868
flex-shrink: 0;
6969
}
7070
@each $category, $colour in $category-colours {
71-
&__cat {
71+
&__category {
7272
&--#{$category} {
73-
#{$toolbox}__cat-colour {
73+
#{$toolbox}__category-colour {
7474
background-color: $colour;
7575
}
7676
}
7777
}
78-
&__cat-return {
79-
#{$toolbox}__cat {
78+
&__category-return {
79+
#{$toolbox}__category {
8080
&--#{$category} {
8181
background-color: $colour;
8282
}
8383
}
8484
}
8585
}
8686

87-
&__cat-menu {
87+
&__category-menu {
8888
display: flex;
8989
flex-direction: column;
9090
flex-grow: 1;
9191
min-height: 0;
9292
overflow: auto;
9393
}
94-
&__cat-return {
94+
&__category-return {
9595
cursor: pointer;
9696
color: $white;
9797
text-align: center;
@@ -100,7 +100,7 @@ $category-colours: (
100100
margin-left: -($category-text-spacing * 2);
101101
}
102102
}
103-
&__cat-text {
103+
&__category-text {
104104
align-self: center;
105105
margin: $category-text-spacing;
106106
width: 100%;
@@ -131,15 +131,15 @@ $category-colours: (
131131
}
132132

133133
@each $category, $colour in $category-colours {
134-
#{$toolbox}__cat {
134+
#{$toolbox}__category {
135135
&--#{$category} {
136-
&:hover:not(#{$toolbox}__cat--selected) {
136+
&:hover:not(#{$toolbox}__category--selected) {
137137
background-image: linear-gradient(to right, $white 25%, transparentize($colour, 0.8) 100%);
138138
}
139139
}
140-
&--#{$category}#{$toolbox}__cat--selected {
140+
&--#{$category}#{$toolbox}__category--selected {
141141
background-color: transparentize($colour, 0.9);
142-
transition: background-color 0.25s ease;
142+
@include vendor(transition, background-color 0.25s ease);
143143
}
144144
}
145145
}

src/scratch/hooks/toolbox.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ Blockly.Toolbox.prototype.showCategory_ = function (category_id) {
8787
* deriv-bot: Custom class names
8888
*/
8989
Blockly.Toolbox.Category.prototype.getMenuItemClassName_ = function(selected) {
90-
const classNames = ['toolbox__item', `toolbox__cat--${this.id_}`];
90+
const classNames = ['toolbox__item', `toolbox__category--${this.id_}`];
9191

9292
if (selected) {
93-
classNames.push('toolbox__cat--selected');
93+
classNames.push('toolbox__category--selected');
9494
}
9595

9696
return classNames.join(' ');
@@ -230,16 +230,16 @@ Blockly.Toolbox.Category.prototype.createDom = function () {
230230
this.item_ = el_item;
231231

232232
if (this.is_category_return_) {
233-
const el_return_arrow = goog.dom.createDom('div', 'toolbox__cat-arrow toolbox__cat-arrow--back');
233+
const el_return_arrow = goog.dom.createDom('div', 'toolbox__category-arrow toolbox__category-arrow--back');
234234
ReactDOM.render(<ArrowIcon className='arrow' />, el_return_arrow);
235235
el_item.appendChild(el_return_arrow);
236236
} else {
237-
const el_colour = goog.dom.createDom('div', 'toolbox__cat-colour');
237+
const el_colour = goog.dom.createDom('div', 'toolbox__category-colour');
238238
el_item.appendChild(el_colour);
239239
}
240240

241241
const el_label = goog.dom.createDom('div', 'toolbox__label', this.name_);
242-
const el_toolbox_text = goog.dom.createDom('div', 'toolbox__cat-text');
242+
const el_toolbox_text = goog.dom.createDom('div', 'toolbox__category-text');
243243

244244
this.label_ = el_label;
245245
el_toolbox_text.appendChild(el_label);
@@ -252,7 +252,7 @@ Blockly.Toolbox.Category.prototype.createDom = function () {
252252
el_item.appendChild(el_toolbox_text);
253253

254254
if (this.has_child_category_) {
255-
const el_category_arrow = goog.dom.createDom('div', 'toolbox__cat-arrow toolbox__cat-arrow--open');
255+
const el_category_arrow = goog.dom.createDom('div', 'toolbox__category-arrow toolbox__category-arrow--open');
256256
ReactDOM.render(<ArrowIcon className='arrow' />, el_category_arrow);
257257
el_item.appendChild(el_category_arrow);
258258
} else if (this.iconURI_) {
@@ -343,7 +343,7 @@ Blockly.Toolbox.Category.prototype.setColour = function(node) {
343343
Blockly.Toolbox.CategoryMenu.prototype.createDom = function() {
344344
const className = this.parent_.horizontalLayout_ ?
345345
'toolbox__horizontal-category-menu' :
346-
'toolbox__cat-menu';
346+
'toolbox__category-menu';
347347

348348
this.table = goog.dom.createDom('div', className);
349349
this.parentHtml_.appendChild(this.table);
@@ -369,7 +369,7 @@ Blockly.Toolbox.CategoryMenu.prototype.populate = function (domTree) {
369369

370370
if (is_category()) {
371371
const row_class = childNode.getAttribute('is_category_return') ?
372-
'toolbox__cat-return' :
372+
'toolbox__category-return' :
373373
'toolbox__row';
374374
const el_row = goog.dom.createDom('div', { class: row_class });
375375

0 commit comments

Comments
 (0)