pxt-core
Version:
Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors
911 lines (767 loc) • 19.6 kB
text/less
/* 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;
@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: rgba(27, 28, 29, 0.3) ;
margin: 0.45rem;
padding: 0.45rem;
border-radius: 0.5rem ;
}
.menubar .ui.menu .item.tutorial-menuitem > .step-label {
margin-left: 0.4em;
margin-right: 0.4em;
}
.menubar .ui.menu .item.tutorial-menuitem > .label {
background: white;
margin-left: 0em;
}
.tutorial-menuitem > .selected {
background-color: @tutorialSelectedMenuColor ;
padding: 1.0rem ;
padding-left: 1.3rem ;
padding-right: 1.3rem ;
}
#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: 20rem;
}
#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 ;
}
/******************************
Tutorial Avatar
******************************/
#tutorialcard .ui.tutorialsegment {
display: flex;
flex-wrap: wrap;
width: 100%;
position: relative;
padding: 0;
border: 0;
border-radius: 0px;
background: @tutorialSegmentBackground;
}
#tutorialcard .ui.tutorialsegment svg {
-webkit-transform: translate3d(0, 0, 0);
}
#tutorialcard {
padding: 0.5rem;
}
.tutorial #tutorialcard .ui.buttons {
width: 100%;
height: calc(@tutorialCardHeight - 1rem);
}
.tutorial.tutorialExpanded #tutorialcard .ui.buttons {
height: 100%;
}
#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 ;
color: @tutorialSegmentColor;
}
.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 ;
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: @primaryColor;
color: @white;
}
span.docs.inlineblock {
padding: 0.05rem .2rem;
border-radius: .2rem;
white-space: nowrap;
background-color: @inlineBlockColor;
color: @white;
font-family: @blocklyFont ;
font-size: 1em ;
&.clickable {
cursor: pointer;
&:hover, &:focus {
opacity: .8;
}
}
}
code.lang-filterblocks {
display: none;
}
#tutorialcard .prevbutton,
#tutorialcard .nextbutton {
background: @tutorialSegmentBackground;
z-index: 2;
> i, > span {
display: block;
margin: 0 auto 0.5em ;
color: @mainMenuTutorialButtons;
}
&:hover, &:focus {
background-color: @lightGrey;
> i, > span, > i.orange {
color: @black ;
}
}
}
#tutorialcard .isValidated {
background: @tutorialCodeValidationCorrectBackground;
> i, > span, > i.nextbutton {
color: @tutorialCodeValidationCorrectTextColor ;
}
i.large.icon, i.large.icons{
font-size: 1.7em;
}
}
/******************************
Hint button
******************************/
#tutorialcard .ui.button.hintbutton {
display: block;
position: relative;
top: 50%;
transform: translateY(-50%);
font-size: 22.5px ;
color: white; // match menubutton color
border-radius: 50%;
transform-style: preserve-3d;
--bubble-pulse-color: @blue;
--bubble-pulse-size: 30px;
&.flash {
border: 2px solid fade(white, 70%) ;
&: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: @blue
// * --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, @blue); }
100% { box-shadow: 0 0 ~'calc(var(--bubble-pulse-size, 30) * 3 / 4)' var(--bubble-pulse-size, 30) var(--bubble-pulse-color, @blue); }
}
/*******************************
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: @white;
z-index: @tutorialLightboxCardZIndex;
border: 8px solid @blue;
box-shadow: 0px 0px 8px 1px rgba(0, 0, 0, .3);
}
.tutorialhint:before,
.tutorial-callout:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
right: 5px;
top: -24px;
bottom: auto;
border: 16px solid;
border-color: transparent @blue 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;
}
.avatar-container .tooltip ,
.avatar-container .tooltip:before {
background-color: @blue;
color: @white;
}
.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.75rem;
padding: 0.5rem 0.8rem;
}
}
.editorlang-text {
#tutorialcard.seemore .tutorialsegment > button {
margin-right: 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,
#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;
}
#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;
}
#mainmenu .immersive-reader-button:focus,
#mainmenu .immersive-reader-button:hover {
background-color: #00000059;
filter: brightness(0.8);
}
.modals .ui.button.immersive-reader-button {
background-image: @immersiveReaderIcon;
width: 2rem;
height: 2.8rem;
background-repeat: no-repeat;
background-size: 60%;
background-color: #f9fafb;
background-position: center;
box-shadow: none;
transition: none;
float: left;
padding-top: 10px;
padding-bottom: 10px;
margin-left: 0;
}
.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-color: #f9fafb;
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: @white;
fill: none;
stroke-linecap: round;
}
/*******************************
Workspace headers
*******************************/
#headers {
display: flex;
position: relative;
height: @workspaceHeaderHeight;
color: @white;
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;
}
}
}
/*******************************
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: @sidebarTutorialColor;
color: #3c3c3c;
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 skills map
*/
.tutorial.tutorial-embed {
#simulator .editor-sidebar, #maineditor, &.sideDocs #sidedocs, .simView #simulators {
top: @tutorialEmbedMenuHeight;
}
.simView #boardview {
padding-top: @tutorialEmbedMenuHeight;
}
.menubar .ui.menu {
height: @tutorialEmbedMenuHeight ;
min-height: @tutorialEmbedMenuHeight ;
}
#mainmenu {
.left.menu, .right.menu {
display: none;
}
.menu {
position: absolute;
height: @tutorialEmbedMenuHeight;
width: 100%;
}
.ui.item.tutorial-menuitem {
background: none ;
}
.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 ;
}
.ui.item.mobile.only {
display: none ;
}
}
}
/*******************************
Media Adjustments
*******************************/
/* > Small Monitor */
@media only screen and (min-width: @computerBreakpoint) {
.thin {
.landscape.only {
display: none;
}
.portrait.hide {
display: none;
}
.portrait.only {
display: block;
height: auto;
}
}
}
/* 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 ;
top: 20%;
--bubble-pulse-size: 16px;
}
.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(20% + 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 skills map
*/
.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);
}
}