pxt-core 7.5.1 → 7.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/cli.js +57 -5
- package/built/pxt.js +194 -11
- package/built/pxtblockly.js +714 -657
- package/built/pxtblocks.d.ts +7 -0
- package/built/pxtblocks.js +159 -40
- package/built/pxtcompiler.js +42 -4
- package/built/pxtlib.d.ts +2 -0
- package/built/pxtlib.js +22 -0
- package/built/pxtpy.js +73 -2
- package/built/server.js +4 -0
- package/built/target.js +1 -1
- package/built/web/authcode/css/main.1cf9dc37.css +2 -0
- package/built/web/authcode/js/main.03da4c20.js +2 -0
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtasseteditor.js +1 -1
- package/built/web/pxtblockly.js +2 -2
- package/built/web/pxtblocks.js +1 -1
- package/built/web/pxtcompiler.js +1 -1
- package/built/web/pxtembed.js +2 -2
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtpy.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/react-common-authcode.css +6008 -0
- package/built/web/react-common-skillmap.css +1 -1
- package/built/web/rtlreact-common-skillmap.css +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/built/web/skillmap/css/{main.4939cd1e.chunk.css → main.e0620cee.chunk.css} +1 -1
- package/built/web/skillmap/js/main.f6866fc6.chunk.js +1 -0
- package/common-docs/faq.md +1 -1
- package/common-docs/translate.md +2 -2
- package/localtypings/pxtblockly.d.ts +1 -0
- package/package.json +5 -3
- package/pxtarget.json +1 -1
- package/react-common/components/controls/EditorToggle.tsx +109 -0
- package/react-common/components/controls/Modal.tsx +1 -1
- package/react-common/components/profile/UserPane.tsx +8 -4
- package/react-common/styles/controls/Button.less +30 -14
- package/react-common/styles/controls/EditorToggle.less +233 -0
- package/react-common/styles/controls/MenuDropdown.less +1 -1
- package/react-common/styles/profile/profile.less +2 -2
- package/react-common/styles/react-common-authcode-core.less +10 -0
- package/react-common/styles/react-common-authcode.less +12 -0
- package/react-common/styles/react-common-variables.less +26 -2
- package/react-common/styles/react-common.less +1 -0
- package/theme/common.less +5 -0
- package/theme/image-editor/imageEditor.less +7 -116
- package/theme/tutorial-sidebar.less +11 -4
- package/webapp/public/authcode.html +1 -0
- package/webapp/public/blockly/blockly_compressed.js +555 -617
- package/webapp/public/index.html +1 -1
- package/webapp/public/skillmap.html +2 -2
- package/built/web/skillmap/js/main.2a4cb15b.chunk.js +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { classList, ControlProps } from "../util";
|
|
4
|
+
import { Button } from "./Button";
|
|
5
|
+
import { MenuDropdown } from "./MenuDropdown";
|
|
6
|
+
|
|
7
|
+
export interface EditorToggleProps extends ControlProps {
|
|
8
|
+
items: EditorToggleItem[];
|
|
9
|
+
selected: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type EditorToggleItem = BasicEditorToggleItem | DropdownEditorToggleItem;
|
|
13
|
+
|
|
14
|
+
export interface BasicEditorToggleItem {
|
|
15
|
+
label: string;
|
|
16
|
+
title: string;
|
|
17
|
+
focusable: boolean;
|
|
18
|
+
icon?: string;
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface DropdownEditorToggleItem extends BasicEditorToggleItem {
|
|
23
|
+
items: BasicEditorToggleItem[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export const EditorToggle = (props: EditorToggleProps) => {
|
|
28
|
+
const {
|
|
29
|
+
id,
|
|
30
|
+
className,
|
|
31
|
+
ariaHidden,
|
|
32
|
+
ariaLabel,
|
|
33
|
+
role,
|
|
34
|
+
items,
|
|
35
|
+
selected
|
|
36
|
+
} = props;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
const hasDropdown = items.some(item => isDropdownItem(item));
|
|
40
|
+
|
|
41
|
+
const onKeydown = (ev: React.KeyboardEvent) => {
|
|
42
|
+
// TODO
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div id={id}
|
|
47
|
+
className={classList("common-editor-toggle", hasDropdown && "has-dropdown", className)}
|
|
48
|
+
role={role || "tablist"}
|
|
49
|
+
aria-hidden={ariaHidden}
|
|
50
|
+
aria-label={ariaLabel}>
|
|
51
|
+
{items.map((item, index) => {
|
|
52
|
+
const isSelected = selected === index;
|
|
53
|
+
return (
|
|
54
|
+
<div key={index}
|
|
55
|
+
className={classList(
|
|
56
|
+
"common-editor-toggle-item",
|
|
57
|
+
isSelected && "selected",
|
|
58
|
+
isDropdownItem(item) && "common-editor-toggle-item-dropdown",
|
|
59
|
+
)} >
|
|
60
|
+
<ToggleButton item={item} isSelected={isSelected} onKeydown={onKeydown} />
|
|
61
|
+
{ isDropdownItem(item) &&
|
|
62
|
+
<MenuDropdown
|
|
63
|
+
id="toggle-dropdown"
|
|
64
|
+
className="toggle-dropdown"
|
|
65
|
+
icon="fas fa-chevron-down"
|
|
66
|
+
title={lf("More options")}
|
|
67
|
+
items={items.map(item => ({
|
|
68
|
+
title: item.title,
|
|
69
|
+
label: item.label,
|
|
70
|
+
onClick: item.onClick,
|
|
71
|
+
leftIcon: item.icon
|
|
72
|
+
}))}
|
|
73
|
+
/>
|
|
74
|
+
}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
})}
|
|
78
|
+
|
|
79
|
+
<div className="common-editor-toggle-handle"
|
|
80
|
+
aria-hidden={true}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface ToggleButtonProps {
|
|
87
|
+
item: BasicEditorToggleItem;
|
|
88
|
+
isSelected?: boolean;
|
|
89
|
+
onKeydown: (ev: React.KeyboardEvent) => void;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const ToggleButton = (props: ToggleButtonProps) => {
|
|
93
|
+
const { item, isSelected, onKeydown } = props;
|
|
94
|
+
const { label, title, onClick, icon, focusable } = item;
|
|
95
|
+
|
|
96
|
+
return <Button
|
|
97
|
+
role={focusable ? "tab" : undefined}
|
|
98
|
+
tabIndex={focusable && isSelected ? 0 : -1}
|
|
99
|
+
onKeydown={onKeydown}
|
|
100
|
+
label={label}
|
|
101
|
+
title={title}
|
|
102
|
+
onClick={onClick}
|
|
103
|
+
leftIcon={icon}
|
|
104
|
+
aria-selected={isSelected} />
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function isDropdownItem(item: EditorToggleItem): item is DropdownEditorToggleItem {
|
|
108
|
+
return !!(item as DropdownEditorToggleItem).items?.length
|
|
109
|
+
}
|
|
@@ -79,7 +79,7 @@ export const Modal = (props: ModalProps) => {
|
|
|
79
79
|
{!fullscreen &&
|
|
80
80
|
<div className="common-modal-close">
|
|
81
81
|
<Button
|
|
82
|
-
className="menu-button"
|
|
82
|
+
className="menu-button inverted"
|
|
83
83
|
onClick={closeClickHandler}
|
|
84
84
|
title={lf("Close")}
|
|
85
85
|
rightIcon="fas fa-times-circle"
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { fireClickOnEnter, CheckboxStatus } from "../util";
|
|
3
3
|
import { UserNotification } from "./UserNotification";
|
|
4
4
|
import { Checkbox } from "../controls/Checkbox";
|
|
5
|
+
import { Button } from "../controls/Button";
|
|
5
6
|
|
|
6
7
|
export interface UserPaneProps {
|
|
7
8
|
profile: pxt.auth.UserProfile;
|
|
@@ -59,10 +60,13 @@ export const UserPane = (props: UserPaneProps) => {
|
|
|
59
60
|
onClick={onDeleteProfileClick}>
|
|
60
61
|
{lf("Delete Profile")}
|
|
61
62
|
</a>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
<Button
|
|
64
|
+
className="sign-out"
|
|
65
|
+
leftIcon="fas fa-sign-out-alt"
|
|
66
|
+
title={lf("Sign Out")}
|
|
67
|
+
label={lf("Sign Out")}
|
|
68
|
+
onClick={onSignOutClick}
|
|
69
|
+
/>
|
|
66
70
|
</div>
|
|
67
71
|
</div>
|
|
68
72
|
}
|
|
@@ -32,22 +32,10 @@
|
|
|
32
32
|
margin-left: 0.5rem;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.common-button
|
|
36
|
-
|
|
37
|
-
position: absolute;
|
|
38
|
-
inset: 4px;
|
|
39
|
-
border: 1px solid transparent;
|
|
40
|
-
outline: @buttonFocusOutline;
|
|
41
|
-
z-index: 1;
|
|
42
|
-
border-radius: 0.2em;
|
|
35
|
+
.common-button-flex {
|
|
36
|
+
white-space: nowrap;
|
|
43
37
|
}
|
|
44
38
|
|
|
45
|
-
.common-button.inverted:focus::after,
|
|
46
|
-
.common-button.menu-button:focus::after {
|
|
47
|
-
outline: @buttonFocusOutlineInverted;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
39
|
/****************************************************
|
|
52
40
|
* Color Variants *
|
|
53
41
|
****************************************************/
|
|
@@ -142,6 +130,34 @@
|
|
|
142
130
|
border: @buttonBackgroundColorDisabled;
|
|
143
131
|
}
|
|
144
132
|
|
|
133
|
+
/****************************************************
|
|
134
|
+
* Focus *
|
|
135
|
+
****************************************************/
|
|
136
|
+
|
|
137
|
+
.common-button:focus::after {
|
|
138
|
+
content: "";
|
|
139
|
+
position: absolute;
|
|
140
|
+
inset: 4px;
|
|
141
|
+
border: 1px solid transparent;
|
|
142
|
+
outline: @buttonFocusOutlineLightBackground;
|
|
143
|
+
z-index: 1;
|
|
144
|
+
border-radius: 0.2em;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.common-button.menu-button:focus::after,
|
|
148
|
+
.common-button.primary:focus::after,
|
|
149
|
+
.common-button.secondary:focus::after,
|
|
150
|
+
.common-button.teal:focus::after,
|
|
151
|
+
.common-button.orange:focus::after,
|
|
152
|
+
.common-button.red:focus::after,
|
|
153
|
+
.common-button.green:focus::after {
|
|
154
|
+
outline: @buttonFocusOutlineDarkBackground;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.common-button.inverted:focus::after {
|
|
158
|
+
outline: @buttonFocusOutlineLightBackground;
|
|
159
|
+
}
|
|
160
|
+
|
|
145
161
|
|
|
146
162
|
/****************************************************
|
|
147
163
|
* Menu Buttons *
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
.common-editor-toggle {
|
|
2
|
+
position: relative;
|
|
3
|
+
border-radius: 0.2rem;
|
|
4
|
+
border: @editorToggleBorderWidth solid @editorToggleBorderColor;
|
|
5
|
+
background: @editorToggleBackgroundColor;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Used in image/tilemap/animation editor
|
|
11
|
+
.common-editor-toggle.slim .common-editor-toggle-item > .common-button {
|
|
12
|
+
padding: .6rem 2rem .75rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.common-editor-toggle-item {
|
|
16
|
+
z-index: 1;
|
|
17
|
+
flex: 3;
|
|
18
|
+
|
|
19
|
+
.common-menu-dropdown {
|
|
20
|
+
flex: 4;
|
|
21
|
+
|
|
22
|
+
& > .common-button {
|
|
23
|
+
padding: 0;
|
|
24
|
+
width: 100%;
|
|
25
|
+
border-left: 1px solid @editorToggleBorderColor;
|
|
26
|
+
border-right: 1px solid @editorToggleBorderColor;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.common-menu-dropdown-pane {
|
|
30
|
+
border-top: 1px solid @editorToggleBorderColor;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
& > .common-button {
|
|
35
|
+
background: none;
|
|
36
|
+
color: @buttonTextColorInverted;
|
|
37
|
+
transition: color .25s;
|
|
38
|
+
margin: 0;
|
|
39
|
+
width: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.common-button:focus::after {
|
|
43
|
+
outline: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown {
|
|
48
|
+
display: grid;
|
|
49
|
+
grid-template-columns: 3fr 1fr;
|
|
50
|
+
flex: 4;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.common-editor-toggle-item.selected {
|
|
54
|
+
.common-menu-dropdown {
|
|
55
|
+
text-align: center;
|
|
56
|
+
|
|
57
|
+
& > .common-button {
|
|
58
|
+
border-right: none;
|
|
59
|
+
color: @buttonTextColor;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
& > .common-button {
|
|
64
|
+
color: @buttonTextColor;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*****************************************************
|
|
69
|
+
* Toggle Handle *
|
|
70
|
+
****************************************************/
|
|
71
|
+
|
|
72
|
+
.common-editor-toggle-handle {
|
|
73
|
+
position: absolute;
|
|
74
|
+
background: white;
|
|
75
|
+
width: 33%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
transition: margin-left .25s, width .25s;
|
|
78
|
+
border-radius: 0.2rem;
|
|
79
|
+
margin-left: -@editorToggleBorderWidth;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.common-editor-toggle {
|
|
83
|
+
/* toggle size, two items, no dropdown */
|
|
84
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-handle { width: 50% }
|
|
85
|
+
|
|
86
|
+
/* toggle positioning, two items, no dropdown */
|
|
87
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 50%; }
|
|
88
|
+
|
|
89
|
+
/* toggle positioning, three items, no dropdown */
|
|
90
|
+
.common-editor-toggle-item:nth-of-type(1).selected ~ .common-editor-toggle-handle { margin-left: 0; }
|
|
91
|
+
.common-editor-toggle-item:nth-of-type(2).selected ~ .common-editor-toggle-handle { margin-left: 33%; }
|
|
92
|
+
.common-editor-toggle-item:nth-of-type(3).selected ~ .common-editor-toggle-handle { margin-left: 67%; }
|
|
93
|
+
|
|
94
|
+
&.has-dropdown {
|
|
95
|
+
/* flex balance, two items, has dropdown (45% to non-dropdown, 55% to dropdown) */
|
|
96
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-item-dropdown,
|
|
97
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown:first-child:nth-last-child(3) { flex: 55 }
|
|
98
|
+
.common-editor-toggle-item:first-child:nth-last-child(3),
|
|
99
|
+
.common-editor-toggle-item-dropdown:first-child:nth-last-child(3) ~ .common-editor-toggle-item { flex: 45 }
|
|
100
|
+
|
|
101
|
+
/* toggle size, two items, has dropdown */
|
|
102
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-handle { width: 45% }
|
|
103
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle,
|
|
104
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown.selected:first-child:nth-last-child(3) ~ .common-editor-toggle-handle { width: 55% }
|
|
105
|
+
|
|
106
|
+
/* toggle positioning, two items, first item has dropdown */
|
|
107
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown:first-child:nth-last-child(3) + .selected ~ .common-editor-toggle-handle { margin-left: 55% }
|
|
108
|
+
|
|
109
|
+
/* toggle positioning, two items, second item has dropdown */
|
|
110
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) + .common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle { margin-left: 45% }
|
|
111
|
+
|
|
112
|
+
/* toggle size, three items, has dropdown */
|
|
113
|
+
.common-editor-toggle-handle { width: 30% }
|
|
114
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle { width: 40%; }
|
|
115
|
+
|
|
116
|
+
/* toggle positioning, three items, has dropdown */
|
|
117
|
+
.common-editor-toggle-item:nth-of-type(2).selected ~ .common-editor-toggle-handle { margin-left: 30%; }
|
|
118
|
+
.common-editor-toggle-item:nth-of-type(3).selected ~ .common-editor-toggle-handle { margin-left: 60%; }
|
|
119
|
+
|
|
120
|
+
/* toggle positioning, three items, first item in toggle has dropdown */
|
|
121
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown + .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 40%; }
|
|
122
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown + .common-editor-toggle-item + .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 70%; }
|
|
123
|
+
|
|
124
|
+
/* toggle positioning, three items, second item in toggle has dropdown */
|
|
125
|
+
.common-editor-toggle-item + .common-editor-toggle-item.common-editor-toggle-item-dropdown + .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 70%; }
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
/*****************************************************
|
|
131
|
+
* Tablet View *
|
|
132
|
+
****************************************************/
|
|
133
|
+
|
|
134
|
+
@media @tabletAndBelow {
|
|
135
|
+
.common-editor-toggle.tablet-compact {
|
|
136
|
+
& > .common-editor-toggle-item > .common-button {
|
|
137
|
+
padding-left: 0.5rem;
|
|
138
|
+
padding-right: 0.5rem;
|
|
139
|
+
.common-button-label {
|
|
140
|
+
display: none;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&.has-dropdown {
|
|
145
|
+
.common-editor-toggle-item {
|
|
146
|
+
flex: 25;
|
|
147
|
+
}
|
|
148
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown {
|
|
149
|
+
flex: 50;
|
|
150
|
+
display: grid;
|
|
151
|
+
grid-template-columns: 1fr 1fr;
|
|
152
|
+
}
|
|
153
|
+
.common-editor-toggle-handle { width: 25%; }
|
|
154
|
+
.common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle { width: 50%; }
|
|
155
|
+
|
|
156
|
+
/* flex balance, two items, has dropdown (33% to non-dropdown, 67% to dropdown) */
|
|
157
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-item-dropdown,
|
|
158
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown:first-child:nth-last-child(3) { flex: 67 }
|
|
159
|
+
.common-editor-toggle-item:first-child:nth-last-child(3),
|
|
160
|
+
.common-editor-toggle-item-dropdown:first-child:nth-last-child(3) ~ .common-editor-toggle-item { flex: 33 }
|
|
161
|
+
|
|
162
|
+
/* toggle size, two items, has dropdown */
|
|
163
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-handle { width: 33% }
|
|
164
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle,
|
|
165
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown.selected:first-child:nth-last-child(3) ~ .common-editor-toggle-handle { width: 67% }
|
|
166
|
+
|
|
167
|
+
/* toggle positioning, two items, first item has dropdown */
|
|
168
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown:first-child:nth-last-child(3) + .selected ~ .common-editor-toggle-handle { margin-left: 67% }
|
|
169
|
+
|
|
170
|
+
/* toggle positioning, two items, second item has dropdown */
|
|
171
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) + .common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle { margin-left: 33% }
|
|
172
|
+
|
|
173
|
+
/* toggle positioning, first item in toggle has dropdown */
|
|
174
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown + .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 50%; }
|
|
175
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown + .common-editor-toggle-item + .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 75%; }
|
|
176
|
+
|
|
177
|
+
/* toggle positioning, second item in toggle has dropdown */
|
|
178
|
+
.common-editor-toggle-item + .common-editor-toggle-item.common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle { margin-left: 25%; }
|
|
179
|
+
.common-editor-toggle-item + .common-editor-toggle-item.common-editor-toggle-item-dropdown + .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 75%; }
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Same as tablet
|
|
185
|
+
@media @mobileAndBelow {
|
|
186
|
+
.common-editor-toggle.mobile-compact {
|
|
187
|
+
& > .common-editor-toggle-item > .common-button {
|
|
188
|
+
padding-left: 0.5rem;
|
|
189
|
+
padding-right: 0.5rem;
|
|
190
|
+
.common-button-label {
|
|
191
|
+
display: none;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&.has-dropdown {
|
|
196
|
+
.common-editor-toggle-item {
|
|
197
|
+
flex: 25;
|
|
198
|
+
}
|
|
199
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown {
|
|
200
|
+
flex: 50;
|
|
201
|
+
display: grid;
|
|
202
|
+
grid-template-columns: 1fr 1fr;
|
|
203
|
+
}
|
|
204
|
+
.common-editor-toggle-handle { width: 25%; }
|
|
205
|
+
.common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle { width: 50%; }
|
|
206
|
+
|
|
207
|
+
/* flex balance, two items, has dropdown (33% to non-dropdown, 67% to dropdown) */
|
|
208
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-item-dropdown,
|
|
209
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown:first-child:nth-last-child(3) { flex: 67 }
|
|
210
|
+
.common-editor-toggle-item:first-child:nth-last-child(3),
|
|
211
|
+
.common-editor-toggle-item-dropdown:first-child:nth-last-child(3) ~ .common-editor-toggle-item { flex: 33 }
|
|
212
|
+
|
|
213
|
+
/* toggle size, two items, has dropdown */
|
|
214
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-handle { width: 33% }
|
|
215
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) ~ .common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle,
|
|
216
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown.selected:first-child:nth-last-child(3) ~ .common-editor-toggle-handle { width: 67% }
|
|
217
|
+
|
|
218
|
+
/* toggle positioning, two items, first item has dropdown */
|
|
219
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown:first-child:nth-last-child(3) + .selected ~ .common-editor-toggle-handle { margin-left: 67% }
|
|
220
|
+
|
|
221
|
+
/* toggle positioning, two items, second item has dropdown */
|
|
222
|
+
.common-editor-toggle-item:first-child:nth-last-child(3) + .common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle { margin-left: 33% }
|
|
223
|
+
|
|
224
|
+
/* toggle positioning, first item in toggle has dropdown */
|
|
225
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown + .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 50%; }
|
|
226
|
+
.common-editor-toggle-item.common-editor-toggle-item-dropdown + .common-editor-toggle-item + .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 75%; }
|
|
227
|
+
|
|
228
|
+
/* toggle positioning, second item in toggle has dropdown */
|
|
229
|
+
.common-editor-toggle-item + .common-editor-toggle-item.common-editor-toggle-item-dropdown.selected ~ .common-editor-toggle-handle { margin-left: 25%; }
|
|
230
|
+
.common-editor-toggle-item + .common-editor-toggle-item.common-editor-toggle-item-dropdown + .common-editor-toggle-item.selected ~ .common-editor-toggle-handle { margin-left: 75%; }
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
-
@media
|
|
338
|
+
@media @computerAndBelow {
|
|
339
339
|
.profile-badges, .profile-badges-background {
|
|
340
340
|
background-size: 25%;
|
|
341
341
|
grid-template-columns: repeat(4, 1fr);
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
@media
|
|
346
|
+
@media @tabletAndBelow {
|
|
347
347
|
.profile-badges, .profile-badges-background {
|
|
348
348
|
background-size: 33%;
|
|
349
349
|
grid-template-columns: repeat(3, 1fr);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is the same as react-common-skillmap.less except it doesn't import any
|
|
3
|
+
* variables from the target. This is used for pxt-core's css build
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Import variables from pxt-core
|
|
7
|
+
@import "themes/default/globals/site.variables";
|
|
8
|
+
@import "themes/pxt/globals/site.variables";
|
|
9
|
+
|
|
10
|
+
@import "react-common.less";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used for building react-common-skillmap.css
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Import variables from pxt-core
|
|
6
|
+
@import "themes/default/globals/site.variables";
|
|
7
|
+
@import "themes/pxt/globals/site.variables";
|
|
8
|
+
|
|
9
|
+
// Import the variables from the target
|
|
10
|
+
@import "site/globals/site.variables";
|
|
11
|
+
|
|
12
|
+
@import "react-common.less";
|
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
@commonBorderColor: rgb(96, 94, 92);
|
|
3
3
|
@commonBackgroundDisabledColor: rgb(243, 242, 241);
|
|
4
4
|
|
|
5
|
+
@mobileBreakpoint: 320px;
|
|
6
|
+
@tabletBreakpoint: 768px;
|
|
7
|
+
@computerBreakpoint: 992px;
|
|
8
|
+
@largeMonitorBreakpoint: 1200px;
|
|
9
|
+
@widescreenMonitorBreakpoint: 1920px;
|
|
10
|
+
|
|
11
|
+
@largestMobileScreen: (@tabletBreakpoint - 1px);
|
|
12
|
+
@largestTabletScreen: (@computerBreakpoint - 1px);
|
|
13
|
+
@largestSmallMonitor: (@largeMonitorBreakpoint - 1px);
|
|
14
|
+
@largestLargeMonitor: (@widescreenMonitorBreakpoint - 1px);
|
|
15
|
+
|
|
16
|
+
@mobileAndBelow: ~"only screen and (max-width: @{largestMobileScreen})";
|
|
17
|
+
@tabletAndBelow: ~"only screen and (max-width: @{largestTabletScreen})";
|
|
18
|
+
@computerAndBelow: ~"only screen and (max-width: @{largestSmallMonitor})";
|
|
19
|
+
@largeMonitorAndBelow: ~"only screen and (max-width: @{largestLargeMonitor})";
|
|
20
|
+
|
|
21
|
+
|
|
5
22
|
/****************************************************
|
|
6
23
|
* Buttons *
|
|
7
24
|
****************************************************/
|
|
@@ -14,8 +31,8 @@
|
|
|
14
31
|
@buttonMenuTextColor: #ffffff;
|
|
15
32
|
@buttonMenuTextColorInverted: @primaryColor;
|
|
16
33
|
@buttonMenuBackgroundColorInverted: @buttonMenuTextColor;
|
|
17
|
-
@
|
|
18
|
-
@
|
|
34
|
+
@buttonFocusOutlineDarkBackground: @buttonTextColorInverted solid 1px;;
|
|
35
|
+
@buttonFocusOutlineLightBackground: @commonBorderColor solid 1px;
|
|
19
36
|
@buttonMenuBackgroundHoverColor: rgba(0,0,0,.1);
|
|
20
37
|
@buttonMenuBackgroundActiveColor: rgba(0,0,0,.15);
|
|
21
38
|
|
|
@@ -57,6 +74,13 @@
|
|
|
57
74
|
@inputButtonColor: rgb(0, 120, 212);
|
|
58
75
|
@inputButtonColorHover: rgb(16, 110, 190);
|
|
59
76
|
|
|
77
|
+
/****************************************************
|
|
78
|
+
* EditorToggle *
|
|
79
|
+
****************************************************/
|
|
80
|
+
@editorToggleBackgroundColor: rgba(52,73,94,.4);
|
|
81
|
+
@editorToggleBorderColor: rgba(52,73,94,.2);
|
|
82
|
+
@editorToggleBorderWidth: 3px;
|
|
83
|
+
|
|
60
84
|
/****************************************************
|
|
61
85
|
* High Contrast *
|
|
62
86
|
****************************************************/
|
package/theme/common.less
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
Layout
|
|
10
10
|
*******************************/
|
|
11
11
|
|
|
12
|
+
@mobileAndBelow: ~"only screen and (max-width: @{largestMobileScreen})";
|
|
13
|
+
@tabletAndBelow: ~"only screen and (max-width: @{largestTabletScreen})";
|
|
14
|
+
@computerAndBelow: ~"only screen and (max-width: @{largestSmallMonitor})";
|
|
15
|
+
@largeMonitorAndBelow: ~"only screen and (max-width: @{largestLargeMonitor})";
|
|
16
|
+
|
|
12
17
|
html {
|
|
13
18
|
height: 100%;
|
|
14
19
|
width: 100%;
|