UNPKG

pxt-core

Version:

Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors

960 lines (806 loc) • 21.5 kB
/* Import all components */ @import 'themes/default/globals/site.variables'; @import 'themes/pxt/globals/site.variables'; /* Reference import */ @import (reference) "semantic.less"; @inlineBlockColor: #D83B01; @highlightLineBackground: #fcfc90; @highlightLineColor: #000; @highlightLineStringColor: #bf0000; @highlightLineNumberColor: #007f00; @highlightLineClassColor: #007f00; @highlightLineKeywordColor: #0000ff; @tutorialCardHeight: 8rem; @tutorialCardMaxHeight: 20rem; @seeMoreButtonHeight: 4rem; @avatarSize: 4.5rem; @avatarMargin: @avatarSize + 0.5rem; @mobileAvatarMargin: 2rem; @workspaceHeaderHeight: 4rem; @sidebarPadding: 1.6rem; @sidebarTutorialHeaderSize: 1.5rem; /******************************* Tutorial mode *******************************/ .tutorial #maineditor > .full-abs { top: @tutorialCardHeight; } .tutorial.flyoutOnly #maineditor > .full-abs { top: calc(@tutorialCardHeight + @workspaceHeaderHeight); } .tutorial.flyoutOnly.sidebarTutorial #maineditor > .full-abs { top: @workspaceHeaderHeight; } /* Tutorial Mode */ .menubar .ui.menu .item.tutorial-menuitem { background: var(--pxt-neutral-alpha20) !important; margin: 0.45rem; padding: 0.45rem; border-radius: 0.5rem !important; } .menubar .ui.menu .item.tutorial-menuitem > .step-label { margin-left: 0.4em; margin-right: 0.4em; } .menubar .ui.menu .item.tutorial-menuitem > .label { background: var(--pxt-neutral-background1); color: var(--pxt-neutral-foreground1); margin-left: 0em; } .tutorial-menuitem > .selected { background-color: var(--pxt-primary-background) !important; padding: 1.0rem !important; padding-left: 1.3rem !important; padding-right: 1.3rem !important; } #mainmenu .tutorial-menu { display: flex; align-items: center; justify-content: center; } #mainmenu .ui.item.tutorialname { cursor: unset; &:hover, &:focus { background: none; } } .tutorial #tutorialcard { position: relative; z-index: @tutorialCardZIndex; height: @tutorialCardHeight; width: 100%; padding-left: 1rem; padding-right: 1rem; font-family: @docsPageFont; } .tutorial #tutorialcard > code, .tutorial #tutorialcard > pre { font-family: @pageFont; } .tutorial.tutorialExpanded #tutorialcard { max-height: @tutorialCardMaxHeight; } #root.dimmable.dimmed #tutorialcard.tutorialReady { z-index: @tutorialLightboxCardZIndex; } #tutorialhint { height: 100%; } #tutorialcontent { position: fixed; top: 0; left: 0; } body#docs.tutorial { overflow-y: hidden; } #docs.tutorial .ui.segment { padding: 0; margin: 0; box-shadow: none; border: none; } #docs.tutorial #root{ margin-bottom: 0.5rem !important; } /****************************** Tutorial Avatar ******************************/ #tutorialcard .ui.tutorialsegment { display: flex; flex-wrap: wrap; width: 100%; position: relative; padding: 0; border: 0; border-radius: 0px; background: var(--pxt-neutral-background2); color: var(--pxt-neutral-foreground2); } #tutorialcard .ui.tutorialsegment svg { -webkit-transform: translate3d(0, 0, 0); } #tutorialcard { padding: 0.5rem; } #tutorialcard.stepExpanded { height: auto; } .tutorial #tutorialcard .ui.buttons { width: 100%; height: calc(@tutorialCardHeight - 1rem); } .tutorial.tutorialExpanded #tutorialcard .ui.buttons { height: 100%; max-height: calc(@tutorialCardMaxHeight - 1rem); } #tutorialcard .ui.tutorialsegment { width: 100%; } .tutorial #tutorialcard .tutorialmessage .content { width: 100%; font-size: 12pt; padding-left: 1rem; height: 100%; margin-bottom: 0.4rem; overflow-x: auto; } .tutorial.tutorialExpanded #tutorialcard .tutorialmessage .content { height: calc(~'100% + 2px'); overflow-y: auto; } #tutorialcard .tutorialmessage .content p, .tutorialhint p, .tutorial-callout p { line-height: 1.4em !important; color: var(--pxt-neutral-foreground2); } .tutorial #tutorialcard .tutorialmessage { width: 100%; padding: 0.5rem; height: calc(@tutorialCardHeight - 1.5rem); overflow: hidden; } .tutorial #tutorialcard.hasHint .tutorialmessage { width: ~'calc(100% - @{avatarMargin} - 0.5rem)'; } .tutorial.tutorialExpanded #tutorialcard .tutorialmessage { height: 100%; } #root.dimmable.dimmed .ui.segment.message { border-radius: 5px; } /* Show / Hide in dimmer */ .ui.showlightbox { display: none; } #root.dimmable.dimmed #tutorialcard.tutorialReady .ui.showlightbox { display: block; } #root.dimmable.dimmed #tutorialcard.tutorialReady .ui.hidelightbox { display: none; } #root.dimmable.dimmed #tutorialcard.tutorialReady .ui.prevbutton, #root.dimmable.dimmed #tutorialcard.tutorialReady .ui.nextbutton { opacity: 0 !important; z-index: -1; } #tutorialcard .ui.button.okbutton { border-radius: 0.28571429rem; } /* Tutorial blocks */ .hintdialog .ui.segment .blocklyPreview { width: 100%; } .ui.modal { .ams-embed, .yt-embed { height: 30rem; width: 80%; max-height: 50vh; } } @media only screen and (min-height: 400px) { .hintdialog .ui.segment .blocklyPreview, .tutorialhint .ui.segment .blocklyPreview, .tutorial-callout .ui.segment .blocklyPreview { max-height: 45vh; } } @media only screen and (max-height: 800px) { .tutorialhint img, .tutorial-callout img { max-height: 30vh; } } /****************************** Inline Blocks and Buttons ******************************/ span.docs.inlinebutton { padding: 0.4rem; border-radius: 0.2rem; white-space: nowrap; background-color: var(--pxt-primary-background); color: var(--pxt-primary-foreground); } span.docs.inlineblock { padding: 0.05rem .2rem; padding-bottom: 0.1rem; white-space: break-spaces; border-radius: 0; border-bottom: 3px solid var(--inline-namespace-color); color: var(--pxt-neutral-foreground1); font-weight: 600; background-color: transparent; font-family: @blocklyFont !important; font-size: 1em !important; i { font-family: 'Icons'; color: var(--inline-namespace-color); font-style: normal; margin-right: 6px; } span.image-icon { background-image: var(--image-icon-url); width: 20px; height: 17px; background-size: contain !important; background-repeat: no-repeat !important; display: inline-block; } &.clickable { cursor: pointer; &:hover, &:focus { opacity: .8; } } } code.lang-filterblocks { display: none; } #tutorialcard .prevbutton, #tutorialcard .nextbutton { background: var(--pxt-neutral-background2); color: var(--pxt-neutral-foreground2); z-index: 2; > i, > span { display: block; margin: 0 auto 0.5em !important; color: var(--pxt-header-background); } &:hover, &:focus { background-color: var(--pxt-target-background1); > i, > span, > i.orange { color: var(--pxt-neutral-foreground1) !important; } } } /****************************** Hint button ******************************/ #tutorialcard .ui.button.hintbutton { display: block; position: relative; top: 50%; transform: translateY(-50%); font-size: 22.5px !important; color: var(--pxt-neutral-background1); // match menubutton color border-radius: 50%; transform-style: preserve-3d; --bubble-pulse-color: var(--pxt-colors-blue-background); --bubble-pulse-size: 30px; &.flash { border: 2px solid var(--pxt-neutral-stencil1) !important; &:before { content: ""; position: absolute; top: 50%; left: 50%; border-radius: 50%; animation-name: bubble-pulse-animation; animation-direction: alternate; animation-iteration-count: infinite; animation-duration: .5s; transform: translateZ(-1px); } } } // use two css variables to customize as needed: // * --bubble-pulse-color, the color to use for the pulse; default: var(--pxt-colors-blue-background) // * --bubble-pulse-radius, the radius for the pulse; default: 30 @keyframes bubble-pulse-animation { 0% { } 20% { box-shadow: 0 0 0 0 var(--bubble-pulse-color, var(--pxt-colors-blue-background)); } 100% { box-shadow: 0 0 ~'calc(var(--bubble-pulse-size, 30) * 3 / 4)' var(--bubble-pulse-size, 30) var(--bubble-pulse-color, var(--pxt-colors-blue-background)); } } /******************************* Tutorial Hint *******************************/ .ui.modal.hintdialog .content p { font-size: 16px; line-height: 25px; } .ui.modal.hintdialog { .ui.segment { display: flex; min-height: 100px; } } .ui.modal.hintdialog, .tutorialsegment .tutorialmessage { img { margin-left: auto; margin-right: auto; } } .tutorialhint, .tutorial-callout { position: absolute; max-width: 100%; min-width: 300px; top: ~'calc(50% + 3rem)'; right: 2rem; padding: 10px 26px; border-radius: 1.2rem; background: var(--pxt-neutral-background1); color: var(--pxt-neutral-foreground1); z-index: @tutorialLightboxCardZIndex; border: 8px solid var(--pxt-colors-blue-background); box-shadow: 0px 0px 8px 1px var(--pxt-neutral-alpha20); } .tutorialhint:before, .tutorial-callout:before { content: ' '; position: absolute; width: 0; height: 0; right: 5px; top: -24px; bottom: auto; border: 16px solid; border-color: transparent var(--pxt-colors-blue-background) transparent transparent; transform: rotateZ(-135deg); } .tutorialhint > .hint-content, .tutorial-callout > .hint-content { max-height: 60vh; overflow: auto; padding-right: 2rem; } .tutorialhint.hidden, .tutorial-callout.hidden { display: none; } .tutorialhint .lang-blocks .segment.raised, .tutorial-callout .lang-blocks .segment.raised { border: none; background: none; box-shadow: none; text-align: center; min-height: 3em; } .shake .icon { animation: shake 1.5s ease-in-out; } .tutorial .mask { position: fixed; left: 0; top: 0; bottom: 0; right: 0; } /******************************* Tutorial Tooltip *******************************/ .avatar-container { left: .7rem; height: 100%; } .avatar-container .tooltip { position: absolute; top: ~'calc(50% + 1.8rem)'; left: auto; width: 10rem; max-width: 175px; z-index: @tutorialCardZIndex + 1; } .avatar-container .tooltip , .avatar-container .tooltip:before { background-color: var(--pxt-colors-blue-background); color: var(--pxt-colors-blue-foreground); } .avatar-container .tooltip:before { right: 3rem; left: auto; } .hideIteration .avatar-container .tooltip:before { right: 2.8rem; } #tutorialcard:not(.showTooltip) .tooltip, #tutorialcard:not(.showTooltip) .tooltip:before { display: none; } /******************************* See More Button *******************************/ #tutorialcard.seemore .tutorialsegment > button { flex-grow: 0; position: relative; width: auto; margin: auto; margin-top: -0.5rem; padding: 0.5rem 0.8rem; } .editorlang-text:not(.hideToolbox) #tutorialcard.seemore .tutorialsegment > button { margin-right: 1rem; } .editorlang-text.hideToolbox #tutorialcard.seemore .tutorialsegment > button { margin-left: 1rem; } /******************************* Tutorial Activity UI *******************************/ #tutorialsteps { padding: 1em 0px; } #tutorialsteps .step-label { margin: 0 1em; min-width: 2rem; max-width: 2rem; } #tutorialsteps .button.nextbutton .text { margin-right: 0.5em; } #tutorialdropdown > .text { margin: 0.5em; } /****************************** Immersive Reader button ******************************/ // TODO (shakao) remove #mainmenu items when cleaning up // old tutorial code #simulator .editor-sidebar .immersive-reader-button.ui.item, #simulator .editor-sidebar .immersive-reader-button.ui.item:focus, .tutorialsegment .immersive-reader-button.ui.item, .tutorialsegment .immersive-reader-button.ui.item:focus, #mainmenu .immersive-reader-button.ui.item, #mainmenu .immersive-reader-button.ui.item:focus { width: 2rem; height: 2rem; background-repeat: no-repeat; background-size: 80%; background-position: center; border-radius: .2em!important; } .tutorialsegment .immersive-reader-button.ui.item, .tutorialsegment .immersive-reader-button.ui.item:focus { background-image: @immersiveReaderIcon; } #tutorialcard .tutorialcard-immersive-reader { position: absolute; top: 0.5em; right: 0; display: flex; justify-content: flex-end; } #mainmenu .immersive-reader-button.ui.item, #mainmenu .immersive-reader-button.ui.item:focus { background-image: @immersiveReaderLightIcon; } #simulator .editor-sidebar .immersive-reader-button.ui.item, #simulator .editor-sidebar .immersive-reader-button.ui.item:focus{ background-image: @immersiveReaderIcon; } .tutorialsegment .immersive-reader-button.ui.item:hover, .tutorialsegment .immersive-reader-button.ui.item:focus { background-color: var(--pxt-neutral-alpha20); filter: brightness(0.9); } #mainmenu .immersive-reader-button:focus, #mainmenu .immersive-reader-button:hover { background-color: var(--pxt-neutral-alpha50); filter: brightness(0.8); } .modals .ui.button.immersive-reader-button { background-image: @immersiveReaderIcon !important; width: 2rem; height: 2.8rem; background-repeat: no-repeat; background-size: 60%; background-position: center; box-shadow: none; transition: none; float: left; padding-top: 10px; padding-bottom: 10px; margin-left: 0!important; } .modals .ui.button.immersive-reader-button:hover, .modals .ui.button.immersive-reader-button:focus { box-shadow: none; background-image: @immersiveReaderIcon; background-repeat: no-repeat; background-size: contain; background-position: center; background-size: 60%; filter: brightness(0.8); } /******************************* Progress Circle *******************************/ .progresscircle { position: absolute; width: 2.3em; height: 2.3em; margin-top: -.3em; margin-left: -.15em; } .progresscircle path { stroke: var(--pxt-neutral-background1); fill: none; stroke-linecap: round; } /******************************* Workspace headers *******************************/ #headers { display: flex; position: relative; height: @workspaceHeaderHeight; color: var(--pxt-neutral-background1); z-index: @simulatorZIndex; #headerToolbar { position: absolute; right: 0; } #flyoutHeader { box-sizing: border-box; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; #flyoutHeaderTitle{ padding-left: 1.2rem; padding-top: .8rem; } } div { display: inline-block; text-align: center; line-height: 2rem; } } .flyoutOnly { #headers { height: @workspaceHeaderHeight; div { display: inline-flex; } } } .hideToolbox #headers #flyoutHeader { display: none; } /******************************* Sidebar Tutorial *******************************/ .flyoutOnly.sidebarTutorial.tutorial { #maineditor{ left: 33.3%; } #maineditor > .full-abs { top: 0; } #maineditor > #blocksArea { top: 3rem; } #sidebar { width: 33.3%; height: 100%; background-color: var(--pxt-target-background2); color: var(--pxt-target-foreground2); font-family: @docsPageFont; padding: @sidebarPadding / 2 @sidebarPadding; overflow-y: auto; .tutorialTitle { font-size: @sidebarTutorialHeaderSize; padding-bottom: 1.6rem; word-wrap: break-word; } .tutorialMessage { font-size: 1.2rem; padding-bottom: 2rem; } #callout { padding: @sidebarTutorialHeaderSize 0 4rem; position: relative; .callout-hint-header { font-size: @sidebarTutorialHeaderSize; } .callout-hint { width: 5rem; height: 5rem; position: absolute; bottom: -1rem; left: 1rem; z-index: 2; } .callout-wrapper { padding: 0 1.5rem; } } } } /** * CSS for embedded tutorial used in the skillmap */ .tutorial.tutorial-embed { #simulator .editor-sidebar, #maineditor, &.sideDocs #sidedocs, .simView #simulators { top: @tutorialEmbedMenuHeight; } .simView #boardview { padding-top: @tutorialEmbedMenuHeight; } .menubar .ui.menu { height: @tutorialEmbedMenuHeight !important; min-height: @tutorialEmbedMenuHeight !important; } #mainmenu { .left.menu, .right.menu { display: none; } .menu { position: absolute; height: @tutorialEmbedMenuHeight; width: 100%; } .ui.item.tutorial-menuitem { background: none !important; } .immersive-reader-button.ui.item { background-size: 1.7rem; } // In the embedded view, always show the navigation dots even in mobile // (instead of progress circle) .ui.item.mobile.hide { display: flex !important; } .ui.item.mobile.only { display: none !important; } } } /******************************* Media Adjustments *******************************/ /* > Small Monitor */ @media only screen and (min-width: @computerBreakpoint) { .thin { .landscape.only { display: none; } .portrait.hide { display: none; } .portrait.only { display: block!important; height: auto!important; } } } /* Large Monitor */ @media only screen and (min-width: @largeMonitorBreakpoint) { } /* Small Monitor */ @media only screen and (min-width: @computerBreakpoint) and (max-width: @largestSmallMonitor) { } /* Tablet */ @media only screen and (min-width: @tabletBreakpoint) and (max-width: @largestTabletScreen) { .avatar-container .tooltip:before { right: 2.1rem; } } /* Mobile */ @media only screen and (max-width: @largestMobileScreen) { #tutorialcard .ui.button.prevbutton { display: none; } #tutorialcard .ui.button.hintbutton { font-size: 12.5px !important; top: 80%; --bubble-pulse-size: 16px; } #tutorialcard .tutorialcard-immersive-reader { right: .5em; } .tutorial #tutorialcard.hasHint .tutorialmessage { width: ~'calc(100% - @{mobileAvatarMargin} - 0.5rem)'; } #tutorialcard:not(.hasHint) .tutorialmessage { width: ~'calc(100% - .5rem)'; } // mobile hint positioning .tutorialhint { top: ~'calc(20% + 2.1rem)'; right: -2rem; } .tutorialhint:before { right: 2rem; top: -20px; } // mobile tutorial tooltip positioning .avatar-container .tooltip { top: ~'calc(80% + 1.1rem)'; } .avatar-container .tooltip:before { right: 2.7rem; } } /* >= Small Monitor (Small Monitor + Large Monitor + Wide Monitor) */ @media only screen and (min-width: @computerBreakpoint) { } /* <= Small Monitor (Mobile + Tablet + Small Monitor) */ @media only screen and (max-width: @largestSmallMonitor) { } /* <= Tablet (Mobile + Tablet) */ @media only screen and (max-width: @largestTabletScreen) { .avatar-container .tooltip { width: 8rem; } #tutorialdropdown { width: auto; } /** * CSS for embedded tutorial used in the skillmap */ .tutorial.tutorial-embed { #simulator .editor-sidebar { top: unset; } } } /* thin screen */ @media only screen and (max-height: @tallEditorBreakpoint) and (min-width: @largestMobileScreen) { .tutorial #tutorialcard { padding-left: 0.5rem; padding-right: 0.5rem; } .tutorial #tutorialcard .content { font-size: 10pt; } .modal.hintdialog img.ui.centered.image { max-height:12rem; } } @keyframes shake { 0% { transform: rotate(0deg); } 10% { transform: rotate(-10deg); } 20% { transform: rotate(10deg); } 30% { transform: rotate(-10deg); } 40% { transform: rotate(10deg); } 50% { transform: rotate(-10deg); } 60% { transform: rotate(10deg); } 70% { transform: rotate(-10deg); } 80% { transform: rotate(10deg); } 90% { transform: rotate(-10deg); } 100% { transform: rotate(0deg); } }