pxt-core
Version:
Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors
1,045 lines (883 loc) • 27.9 kB
text/less
/* Import all components */
@import 'themes/default/globals/site.variables';
@import 'themes/pxt/globals/site.variables';
/* Reference import */
@import (reference) "semantic.less";
/*******************************
High Contrast
*******************************/
@selected: yellow;
@disabled: #3ff23f;
@hyperlink: #807FFF;
/* Messages */
#msg .hc {
background-color: black ;
border: 1px solid white ;
border-radius: 0em;
color: white ;
}
@HCRootBackground: black;
@HCblocklySvgColor: black;
@HCsimulatorBackground: black;
@HCblocklySvgColor: black;
@HCmainMenuBackground: white;
@HCmainMenuTextColor: black;
@HCmainMenuInverseTextColor: white;
@HCblocklyToolboxColor: black;
@HCblocklyTreeLabelColor: white;
@HCblocklyTreeLabelSelectedColor: white;
@HCeditorToolsBackground: black;
@HCbackground: black;
@HCtextColor: white;
@HChomeScreenBackground: black;
@HCaccessibleMenuBackground: black;
@HCaccessibleMenuColor: white;
.hc {
/*
* Generic Focus Highlights
*/
*[tabindex='0']:not(.blocklyWorkspace, .blocklyPassiveFocus, .blocklyTreeInner),
*[tabindex*='d1'],
*[tabindex*='d2'], /* Takes items with a defined tabIndex from 0 to 29. */
*[role='menuitem']:not(.editor-menuitem),
a:not([tabindex='-1']),
input:not([tabindex='-1']),
button:not([tabindex='-1']),
#monacoEditor .blocklyTreeRow,
#monacoEditor .monacoDraggableBlock {
&:focus, &:hover {
outline: 3px solid var(--pxt-colors-yellow-background) ;
}
}
p:not(#sidedocs p) {
color: @HCtextColor ;
background-color: @HCbackground ;
}
/* semantic */
.ui.toggle.checkbox .box, .ui.toggle.checkbox label,
.ui.toggle.checkbox input:focus:checked~.box, .ui.toggle.checkbox input:focus:checked~label,
.ui.checkbox+label, .ui.checkbox label,
.ui.items>.item .meta {
color: @HCtextColor ;
}
p > a.ui.link {
text-decoration: underline;
}
ul > li {
color: @HCtextColor;
}
#tutorialcard .prevbutton,
#tutorialcard .nextbutton {
&:hover, &:focus {
> i, > span, > i.orange {
color: @HCtextColor ;
}
}
}
@media all and (pointer:coarse) { /* If touch screen */
*[tabindex='0'],
*[tabindex*='d1'],
*[tabindex*='d2'],
*[role='menuitem'],
a:not([tabindex='-1']),
input:not([tabindex='-1']),
button:not([tabindex='-1']),
#monacoEditor .blocklyTreeRow,
#monacoEditor .monacoDraggableBlock {
&:focus, &:hover {
outline: @editorFocusBorderSize solid transparent ;
}
}
}
.blocklyWidgetDiv *,
.blocklySVG *,
.monaco-editor *,
#monacoEditor *,
.blocklyTreeRoot {
&:focus, &:hover {
outline: none ;
}
}
/* Toolbox */
#monacoEditor .monacoDraggableBlock {
background: none ;
span.argName {
border: 1px solid rgba(255, 255, 255, .7);
}
}
/* ErrorList */
.errorList {
background-color: @HCbackground ;
color: @HCtextColor ;
.errorListHeader:focus {
border: 1px @selected solid ;
}
.errorListInner {
.ui.selection.list > .item {
background-color: @HCbackground ;
color: @HCtextColor ;
border: 1px solid @HCtextColor ;
&:focus {
border: 1px solid @selected;
}
}
.debuggerSuggestion {
color: @HCtextColor ;
}
.label {
color: @HCtextColor ;
}
}
}
/* Blockly flyout */
path.blocklyFlyoutBackground {
fill: @HCblocklySvgColor ;
fill-opacity: 1 ;
stroke-width: 4px;
stroke: @HCblocklyTreeLabelColor;
}
.blocklyFlyoutButton .blocklyText {
fill: @HCtextColor ;
}
.monacoFlyout {
background: @HCblocklySvgColor ;
border-right: 4px solid @HCtextColor ;
.monacoBlock {
color: @HCtextColor ;
}
.blockHandle {
background: @HCblocklySvgColor ;
}
}
.blocklyFlyoutButtonBackground {
stroke: @HCtextColor ;
fill: transparent ;
}
/* Main editor areas */
#root {
background: @HCRootBackground ;
}
#simulator .editor-sidebar {
background: @HCsimulatorBackground ;
#boardview {
background: @HCsimulatorBackground ;
}
}
svg.blocklySvg {
background: @HCblocklySvgColor ;
}
.blocklyMainBackground {
fill: transparent ;
}
.blocklyToolbox, .monacoToolboxDiv {
background: @HCblocklyToolboxColor ;
border-right: 1px solid @HCblocklyTreeLabelColor ;
}
.blocklyPath {
stroke-width: 3px;
}
.cloudstatusarea {
color: @HCtextColor ;
.ui.loader:after {
border-top-color: @HCtextColor ;
}
}
/* Menu bar */
.menubar .menu > .item:focus > i,
.menubar .menu > .item:focus > span {
color: @selected ;
}
.menu .ui.label.betalabel {
color: @HCbackground ;
}
#mainmenu:not(.inverted) {
background-color: @HCmainMenuBackground ;
color: @HCmainMenuTextColor ;
border-bottom: 4px solid @HCtextColor;
.ui.item {
color: @HCmainMenuTextColor;
}
.item.editor-menuitem .ui.grid {
border: 1px solid @HCbackground ;
}
}
#mainmenu.inverted {
color: @HCmainMenuBackground ;
border-bottom: 4px solid @HCtextColor;
background: @HCmainMenuTextColor ;
.ui.item {
color: @HCmainMenuBackground;
}
.item.editor-menuitem .ui.grid {
border: 1px solid @HCtextColor ;
}
}
.simtoolbar .debug-button.orange {
color: @HCeditorToolsBackground ;
background-color: @HCtextColor ;
}
/* Debugger toolbox */
.debugtoolbar .ui.compact.menu {
color: @HCblocklyTreeLabelColor ;
background-color: @HCblocklyToolboxColor ;
border-bottom: solid @HCblocklyTreeLabelColor 1px ;
.ui.item.link.dbg-btn {
.icon.green, .icon.blue, .ui.text, .xicon {
color: @HCblocklyTreeLabelColor ;
}
}
.ui.item.link.dbg-btn.disabled {
.icon.green, .icon.blue, .ui.text, .xicon, .icon.disabled.icon-and-text {
opacity: 1 ;
color: @disabled ;
}
}
.ui.item.link.dbg-btn.dbg-trace.tracing {
background-color: @HCtextColor ;
.xicon {
color: @HCblocklyToolboxColor ;
}
}
}
.varExplorer {
background-color: @HCblocklyToolboxColor ;
.variableTableHeader, .variableTablePlaceholder {
color: @HCblocklyTreeLabelColor ;
background-color: @HCblocklyToolboxColor ;
}
.ui.segment.debugvariables {
.item {
background-color: @HCblocklyToolboxColor ;
.variableAndValue {
.variable.varname, .variable.detail {
color: @HCblocklyTreeLabelColor ;
.varval.number, .varval.string, .varval.boolean, .varval.array, .varval.Sprite {
color: @HCblocklyTreeLabelColor ;
}
}
}
}
}
}
/* Editor switch toggle */
.menubar .ui.menu.fixed .item.editor-menuitem .ui.grid {
background: @HCbackground ;
.item:not(.active) {
opacity: 1 ;
color: @HCmainMenuInverseTextColor ;
}
.item.active,
.menu > .item.selected {
background: @HCtextColor ;
color: @HCmainMenuTextColor ;
}
.dropdown, .dropdown:hover {
.selected i, .selected span {
color: @HCmainMenuTextColor ;
}
}
.dropdown.active:hover:not(.visible) i {
color: @HCmainMenuTextColor ;
}
.dropdown:focus:not(.visible) i,
.dropdown.active:focus:not(.visible) i {
color: @HCtextColor ;
}
}
/* Editor toolbar */
#editortools, #downloadArea {
background: @HCeditorToolsBackground ;
}
#editortools {
border-top: 4px solid @HCtextColor;
}
/* Buttons */
.ui.button {
background: @HCbackground ;
color: @HCtextColor ;
border: 1px solid @HCtextColor ;
&:focus, &:hover {
color: @HCtextColor ;
outline: @editorFocusBorderSize solid @selected;
background: @HCbackground ;
i, span {
color: @HCtextColor ;
}
}
.inverted.icon {
color: @HCtextColor ;
}
}
.ui.button.disabled {
opacity: 1 ;
border: 1px solid @disabled ;
i, span {
color: @disabled ;
}
}
.filemenu .ui.button,
.header-close .ui.button {
&:focus, &:hover {
color: @selected ;
i, span {
color: @selected ;
}
}
}
.signin-button {
background-color: @HCbackground;
color: @HCtextColor;
border: 1px solid @HCtextColor ;
}
/* Inputs */
.ui.input input,
.ui.input .input {
background: @HCbackground ;
color: @HCtextColor ;
border: 1px solid @HCtextColor ;
}
.ui.form {
.field>label {
color: @HCtextColor ;
}
input,
textarea,
.ui.secondary.segment {
background: @HCbackground ;
color: @HCtextColor ;
border: 1px solid @HCtextColor ;
}
}
input,
.input,
.ui.form {
::placeholder {
color: darken(@HCtextColor, 20.0) ;
}
::selection {
color: @HCbackground ;
background: @HCtextColor ;
}
}
.ui.header {
color: @HCtextColor ;
}
/* Home screen */
.projectsdialog, .projectsdialog .tabsegment {
background: @HChomeScreenBackground ;
color: @HCtextColor ;
border-color: @HCtextColor ;
.header,
span.view-all-button {
opacity: 1 ;
color: @HCtextColor ;
}
.homefooter a,
.homefooter i {
color: @HCtextColor
}
.getting-started-segment.hero .dots button.active {
background: @selected ;
border-color: @HCbackground ;
}
}
#homescreen .ui.home .tutorial-progress {
border-color: @HCtextColor ;
background-color: @HCbackground ;
color: @HCtextColor ;
}
.projectsdialog {
.gallerysegment {
.ui.header {
&.myproject-header {
&:focus, &:hover {
text-decoration: underline;
color: @HCtextColor;
}
}
}
}
.detailview {
.closeIcon .remove.icon {
background-color: @HCbackground;
}
.header {
color: @HCtextColor;
}
.ui.grid {
background-color: @HChomeScreenBackground;
border-width: 2px 0;
border-color: @HCtextColor;
border-style: solid;
}
.ui.grid.stackable .actions {
.card-action {
border: 2px solid @HCtextColor;
.button.attached i {
opacity: 1;
color: @HCtextColor;
}
}
.card-action-title {
color: @HCtextColor;
}
.card-action:hover,
.card-action:focus-within {
border-color: @selected;
}
}
}
}
.ui.card.link.newprojectcard{
background: var(--pxt-primary-accent) ;
color: var(--pxt-primary-foreground);
}
.ui.image~.content {
background: rgba(0,0,0,.75) ;
}
.ui.form .content .description {
color: @HCtextColor;
}
.ui.table {
th, tr, i,
th.positive, tr.postive {
color: @HCtextColor ;
background: @HCbackground ;
}
}
.carouselarrow {
background: @HCbackground;
color: @HCtextColor;
border: 2px solid @HCtextColor ;
}
/* banners */
#notificationBanner {
background: @HCbackground ;
border: 2px solid @HCtextColor ;
.header {
color: @HCtextColor ;
}
}
.ui.message {
background: @HCbackground ;
color: @HCtextColor ;
border: 2px solid @HCtextColor ;
}
#winAppError {
img {
background-color: white;
}
#winAppErrorMsg {
color: @HCtextColor;
}
}
/* Cards */
.card:not(.icon) {
background: @HCbackground ;
border: 2px solid @HCtextColor ;
border-radius: initial ;
box-shadow: initial ;
.header, .description, .meta {
color: @HCtextColor ;
}
&:focus, &:hover {
.header, .meta, .description {
color: @selected ;
}
}
.ui.orange.labels .label, .ui.orange.label {
background: @disabled ;
border-color: @disabled ;
color: @HCbackground ;
}
}
/* File menu */
.filemenu {
.item, .ui.button {
background: @HCbackground ;
color: @HCtextColor ;
border: 1px solid @HCtextColor ;
}
.item:focus {
border-color: @selected ;
}
}
/* PxtJson */
#maineditor {
border-left: 1px solid @HCtextColor ;
background: @HCbackground;
.ui.segment {
border: 1px solid @HCtextColor;
background: @HCbackground;
color: @HCtextColor;
.ui.toggle.checkbox {
label {
color: @HCtextColor ;
}
.box:before, label:before {
border: 1px solid @HCtextColor;
}
}
}
}
/* Serial editor */
#serialPreview div {
color: @HCtextColor;
}
#serialCharts .ui.segment,
#serialPlaceholder.ui.segment {
background-color: @HCtextColor;
}
#serialEditor {
background-color: @HCbackground;
}
#serialHeader .ui.header {
color: @HCbackground;
}
#serialConsole {
background-color: @HCbackground;
color: @HCtextColor;
border-color: @HCtextColor;
}
#serialPreview .label {
border: 10px solid @HCtextColor ;
&:hover {
border-color: darken(@HCtextColor, 10.0) ;
}
&:focus {
outline: 3px solid @selected ;
outline-offset: -15px;
}
}
.ui.button.labeled.icon.editorBack {
background: @HCtextColor ;
}
// Serial csv
#serialArea #serialCsv {
background-color: @HCbackground ;
tr {
background-color: @HCbackground ;
}
td, th {
border-color: @HCtextColor ;
color: @HCtextColor ;
}
}
/* Asset Editor */
#assetEditor {
.asset-editor-sidebar,
.asset-editor-sidebar-preview,
.asset-editor-preview,
.asset-editor-sidebar-temp {
color: @HCtextColor;
background-color: @HCbackground;
border-color: @HCtextColor;
}
.asset-editor-gallery-tab {
color: @HCtextColor;
background-color: @HCbackground;
border-right: 1px solid @HCtextColor;
}
.asset-editor-topbar {
border-bottom: 1px solid @HCtextColor;
}
.common-button {
border: 1px solid;
}
.asset-editor-card,
.create-new {
color: @HCtextColor;
background: @HCbackground;
border: 1px solid @HCtextColor;
box-shadow: none;
}
.asset-editor-card-label {
color: @HCbackground;
}
.asset-editor-card.selected,
.asset-editor-gallery-tab.selected,
.asset-editor-button:hover,
.create-new:hover {
border: 2px solid @selected;
}
}
.asset-editor-create-button {
background-color: @HCbackground;
border: 1px solid @HCtextColor;
&:hover {
border: 2px solid @selected;
}
}
/* Hyperlinks */
a {
color: @hyperlink ;
text-decoration: underline ;
}
/* Dropdown */
.ui.dropdown .menu,
.ui.menu .ui.dropdown .menu {
border: 1px solid @HCtextColor ;
}
.ui.dropdown .menu,
.ui.dropdown .menu > .item,
.ui.dropdown .menu > .item:hover,
.ui.menu .ui.dropdown .menu,
.ui.menu .ui.dropdown .menu > .item,
.ui.menu .ui.dropdown .menu > .item:hover {
background: @HCbackground ;
color: @HCtextColor ;
&:focus {
color: @HCtextColor ;
font-weight: normal ;
i, span {
color: @HCtextColor ;
font-weight: normal ;
}
}
}
.ui.dropdown .menu > .divider,
.ui.menu .ui.dropdown .menu > .divider {
background: @HCbackground ;
border-top: 1px solid @HCtextColor ;
}
#editordropdown .menu > .item:not(.selected) {
background: transparent ;
}
/* Tab list in Modals*/
.ui.secondary.menu > .item,
.ui.secondary.pointing.menu > .item,
.ui.secondary.inverted.menu .link.item {
color: @HCtextColor ;
border: 1px solid @HCtextColor ;
}
.ui.secondary.menu > .item.active, .ui.secondary.menu > .item.active:hover,
.ui.secondary.pointing.menu > .item.active, .ui.secondary.pointing.menu > .item.active:hover {
border: 2px solid @selected ;
border-radius: initial ;
box-shadow: initial ;
}
/* Tutorial */
.ui.tutorialsegment {
background-color: @HCbackground ;
color: @HCtextColor ;
.tutorialmessage {
border: none ;
&:focus {
color: @selected ;
}
}
.tooltip, .tooltip:before {
background-color: @HCbackground;
border: 2px solid @HCtextColor;
color: @HCtextColor;
}
.tooltip:before {
border-color: @HCtextColor transparent transparent @HCtextColor ;
}
}
.tutorialhint, .tutorial-hint .tutorial-callout {
border-color: @HCtextColor;
background-color: @HCbackground;
color: @HCtextColor;
.hint-title {
margin: 0;
> span {
background-color: @HCbackground;
color: @HCtextColor;
}
}
&:before {
border-right-color: @HCtextColor;
}
}
/* Tabbed tutorial */
.tutorial-container-outer { background-color: @HCbackground; }
.tutorial-content-bkg { background-color: @HCbackground; }
.tutorial-step-counter { background-color: @HCbackground; }
.tutorial-scroll-gradient { display: none; }
.tutorial-title { color: @HCtextColor; }
.tutorial-step-counter {
border-color: @HCtextColor;
}
.tutorial-step-bar {
background-color: @HCbackground;
border: 1px solid @HCtextColor;
}
.tutorial-step-label { color: @HCtextColor; }
.tutorial-step-bar-fill { background-color: @HCtextColor; }
.tutorial-step-bubbles > button {
border: 1px solid @HCtextColor;
}
#simulator .editor-sidebar:not(.topInstructions) {
border-right: 1px solid @HCtextColor;
}
#simulator .topInstructionsWrapper .editor-sidebar {
border-bottom: 1px solid @HCtextColor;
}
#simulator .editor-sidebar .tab-navigation {
color: @HCtextColor;
background-color: @HCbackground;
border-bottom: 2px solid @HCtextColor;
.active {
color: @HCbackground;
background-color: @HCtextColor;
}
.tab-badge {
display: none;
}
}
&.tabTutorial details {
background-color: @HCbackground ;
border: 2px solid @HCtextColor ;
color: @HCtextColor ;
}
.ui.label {
background-color: @HCbackground ;
border: 2px solid @HCtextColor ;
}
.ui.blue.labels .label, .ui.blue.label {
border-color: @selected ;
}
.formatted-bullet {
background: linear-gradient(@HCtextColor, @HCtextColor) ~"no-repeat 45%/2px 100%";
i.icon, i.xicon {
color: @HCbackground;
background-color: @HCtextColor;
}
&:after {
border-color: @HCtextColor ;
}
}
// Tutorial tablet mode
@media only screen and (max-width: @largestTabletScreen) {
.editor-sidebar {
border-bottom: 1px solid @HCtextColor;
}
}
/* Modals */
.ui.modal {
border: 2px solid @HCbackground ;
border-radius: initial ;
box-shadow: initial ;
> .closeIcon .close {
color: @HCtextColor ;
}
}
.ui.modal.inverted-theme {
border: 2px solid @HCtextColor ;
border-radius: initial ;
box-shadow: initial ;
}
.ui.modal, .ui.modal > .header, .ui.modal > .content, .ui.modal > .actions, .ui.modal > .segment {
background: @HCbackground ;
color: @HCtextColor ;
}
/* Accessible menu */
.ui.menu.accessibleMenu, #accessibleMenu {
.ui.item.link {
color: @HCaccessibleMenuColor ;
background: @HCaccessibleMenuBackground ;
}
}
[data-tooltip]:after,
[data-tooltip]:before {
color: @HCtextColor;
background-color: @HCbackground;
}
[data-tooltip]:after {
border: 1px solid @HCtextColor;
}
[data-tooltip]:before {
box-shadow: 1px 1px 0 0 @HCtextColor;
}
/* immersive reader */
.modals .ui.button.immersive-reader-button,
#mainmenu .immersive-reader-button.ui.item,
#simulator .editor-sidebar .immersive-reader-button.ui.item {
border: 1px solid #fff;
background-image: @immersiveReaderLightIcon ;
background-repeat: no-repeat ;
background-size: 80% ;
background-position: center;
}
.modals .ui.button.immersive-reader-button:focus,
.modals .ui.button.immersive-reader-button:hover,
#mainmenu .immersive-reader-button.ui.item:focus,
#mainmenu .immersive-reader-button.ui.item:hover,
#simulator .editor-sidebar .immersive-reader-button.ui.item:focus,
#simulator .editor-sidebar .immersive-reader-button.ui.item:hover {
background-color: white ;
background-image: @immersiveReaderIcon ;
background-repeat: no-repeat ;
background-size: 80% ;
background-position: center;
filter: none;
}
// skillmap embedded tutorials
.tutorial.tutorial-embed {
.immersive-reader-button.ui.item,
.immersive-reader-button.ui.item:focus,
.immersive-reader-button.ui.item:hover {
background-size: 80%;
background-color: transparent;
filter: none;
}
}
/* github */
#githubEditor {
background-color: @HCbackground ;
color: @HCtextColor ;
.ui.button {
color: @HCtextColor ;
&:focus, &:hover {
color: @HCtextColor ;
border-color: @selected ;
background: @HCbackground ;
i, span {
color: @HCtextColor ;
}
}
}
table.diffview {
background: @HCbackground ;
color: @HCtextColor ;
.diff-marker, .diff-removed, .diff-added, code.ch-removed, code.ch-added {
background: @HCbackground ;
color: @HCtextColor ;
}
.diff-marker {
border-bottom: 1px solid @HCtextColor ;
}
.diff-removed, code.ch-removed {
border: 2px dashed #900 ;
}
.diff-added, code.ch-added {
border: 2px dotted #090 ;
}
}
}
.ui.dropdown > .avatar > .initials {
background-color: @HCbackground ;
}
}
/* OS-specific Fixes (eg Windows High Contrast) */
@media (forced-colors: active) {
.ui.toggle.checkbox .box:after,
.ui.toggle.checkbox label:after {
forced-color-adjust: none;
}
}
@media (forced-colors: active) and (prefers-color-scheme: light) {
#mainmenu .logo.organization img,
#mainmenu .logo.brand img {
filter: invert(1);
}
}
/* > Small Monitor */
@media only screen and (min-width: @computerBreakpoint) {
/* Hide the editor toolbor in tutorial mode */
.hc.tutorial #editortools {
background: transparent ;
border-top: 0px;
}
}