// Use this file only for editor styles // (changes to the renderer will not work in production) // // Draft.js CSS @import (less) "../../lib/Draft.css"; .public-DraftEditor-content { padding: @editorPadding; min-height: 50px; } .public-DraftEditorPlaceholder-root { padding: @editorPadding; } // Variables // Should be consistent with webapp's variables.less // Colors @grayDarker: #333; @gray: #999; @grayExtraLight: #eee; @grayLighter: #ddd; @white: #fff; // Editor Style @editorBorderWidth: 1px; @editorBorder: @editorBorderWidth solid @grayLighter; @editorBorderRadius: 3px; @editorPadding: 10px; @widgetBorderWidth: 1px; @widgetBorderColor: #ccc; @widgetBorder: @widgetBorderWidth solid @widgetBorderColor; @widgetBorderRadius: 3px; // Dimensions @leftCellWidth: 360px; @cellPadding: 30px; // Colors @wrongRed: #ffcccc; @correctGreen: #aaffaa; @ungradedBlue: #d9edf7; .border-box-sizing() { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .size(@width: auto, @height: auto) { height: @height; width: @width; } .position(@position: static, @top: auto, @right: auto, @bottom: auto, @left: auto) { position: @position; top: @top; right: @right; bottom: @bottom; left: @left; } .user-select (@select) { -webkit-user-select: @select; -khtml-user-drag: @select; -khtml-user-select: @select; -moz-user-select: @select; -ms-user-select: @select; user-select: @select; } .pod-title { background-color: @grayExtraLight; border: 1px solid @grayLighter; border-bottom: 0; font-size: 1.25em; padding: 4px 10px; border-radius: @editorBorderRadius @editorBorderRadius 0 0; &.closed { border-radius: @editorBorderRadius; } } .smiley { position: absolute; left: 0px; top: 4px; } // // General editor styles // .perseus-single-editor { box-sizing: border-box; width: 100%; } .perseus-json-editor { width: 100%; font-family: monospace; height: 500px; } .perseus-json-editor.invalid { background-color: #ffe6e6; } .perseus-textarea-pair { border: 1px solid @grayLighter; font-size: 12px; line-height: 1.6; position: relative; } .perseus-textarea-pair > .perseus-textarea-underlay { color: transparent; margin-bottom: 12px; padding: @editorPadding; white-space: pre-wrap; word-wrap: break-word; } .perseus-textarea-pair > .perseus-textarea-underlay b { font-weight: normal; background-color: #dfd; } .perseus-textarea-pair > .perseus-textarea-underlay b.selected { background-color: #ddf; } .perseus-textarea-pair > .perseus-textarea-underlay b.error { background-color: #fcc; } .perseus-textarea-pair > textarea { background: transparent; border: 0; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; font: inherit; height: 100%; left: 0; overflow: hidden; padding: @editorPadding; position: absolute; resize: none; top: 0; width: 100%; } .perseus-widget-row { margin: 7px 0; width: 100%; .perseus-widget-left-col, .perseus-widget-right-col { display: inline-block; width: 50%; .range-input { float: right; margin-right: 5px; } } > .range-input { margin-left: 10px; } } .perseus-answer-options { border: @editorBorder; padding: @editorPadding; } .perseus-answer-widget { border: @editorBorder; border-radius: 0 0 @editorBorderRadius @editorBorderRadius; padding: @editorPadding; } .perseus-answer-none { & > div { display: none; } border-bottom: @editorBorder; } .perseus-widget-editor { border: @editorBorder; border-radius: @editorBorderRadius; margin-top: 10px; .perseus-widget-editor-title { .pod-title; border: 0; display: flex; align-items: center; position: relative; :first-child { flex-grow: 1; } > a { color: inherit; text-decoration: none; } .alignment { margin-right: 5px; } .simple-button { font-size: 13px; padding: 0 10px; } } .perseus-widget-editor-content { border-radius: 0 0 @editorBorderRadius @editorBorderRadius; border-top: @editorBorder; padding: @editorPadding; transition: all 0s; &.enter {} &.leave { display: none; } } // Are any widgets capable of overflowing in the editor interface? .categorizer-container { overflow-x: scroll; } } .perseus-widget-editor-title-id > svg { float: left; font-size: 14px; margin-right: 10px; } .perseus-editor-widgets-selectors { background-color: @grayExtraLight; border: 1px solid @grayLighter; border-top: 0; border-radius: 0 0 @editorBorderRadius @editorBorderRadius; display: flex; flex-wrap: wrap; padding: @editorPadding/2; select { margin: 2px; } } .perseus-editor-widgets > div.selected > strong { background-color: #ddf; } .perseus-editor-widgets .warning { background-color: @wrongRed; padding: 4px; margin: 4px; } .perseus-editor-word-count { cursor: help; flex: 1; float: right; margin-right: 3px; margin-top: 2px; text-align: right; } // // Misc styles // .MathJax .math { // override athena silliness color: inherit; } // // DOM-based styles that overwrite rules set in khan-exercise.css // #perseus { margin: 20px; // Question area styles #problemarea { /* Override the min-height property used for displaying the problem. While editing, the size of the editor itself is a better constraint on the size of the problemarea, and having a smaller problemarea is nicer if it means it aligns better with the editor. */ min-height: 0; // Force the hint width to take up the width of its containing viewport. width: 100%; #workarea { margin: 0; // override ke } } // Space out the question, answer, and hint areas .perseus-question-container > div, .perseus-answer-container > div { padding-bottom: 25px; } // Add radio choice/hint button styles .add-choice-container, .add-hint-container { margin-bottom: 20px; text-align: left; } } // // Table styles for Editor/Renderer pairs // .perseus-editor-table { clear: both; display: table; table-layout: fixed; } .perseus-editor-row { display: table-row; } .perseus-editor-left-cell { display: table-cell; padding-right: 30px; vertical-align: top; width: @leftCellWidth; max-width: @leftCellWidth; min-width: @leftCellWidth; } .perseus-editor-right-cell { .border-box-sizing(); display: table-cell; padding: @cellPadding; padding-top: 5px; vertical-align: top; } // // Hint Editor // .perseus-hint-editor { padding-bottom: 20px; .perseus-single-editor { margin-bottom: 5px; } .reorder-hints button { font-size: 16px; &:hover, &:active { color: #000; text-decoration: none; } &.hidden { visibility: hidden; } } .remove-hint { float: right; font-size: 13px; padding: 0 10px; } } .perseus-hints-editor { .add-hint { font-size: 13px; } // Prevent double-thick border between question area and hint area .perseus-editor-row:first-child .perseus-editor-right-cell { border-top: 0; } } // Only apply borders to hints if they immediately follow a hint-editor .perseus-hint-editor + div .perseus-hint-renderer { div.paragraph { margin: 0px 0px 22px 0px; } // Force the hint width to take up the width of its containing viewport. width: 100%; } // Article Editor .perseus-article-editor { margin-bottom: 20px; margin-top: 20px; .perseus-editor-table { margin-left: auto; margin-right: auto; } .perseus-single-editor { margin-bottom: 10px; } .section-control-button, .step-control-button { font-size: 13px; padding: 2px 10px; margin: 0 2px; } .perseus-editor-left-cell { min-width: 360px; } .mobile-preview, .desktop-preview, .editor-preview, .standalone-preview { box-sizing: border-box; } .mobile-preview { border: 1px solid rgba(0, 0, 0, 0.29); // Account for border max-width: 322px; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.29); padding: 32px 16px; } .desktop-preview { border: 1px solid transparent; padding: 32px 20px; } .editor-preview { display: table-cell; &.full-width { width: 100%; } .desktop-preview { border: 1px solid rgba(0, 0, 0, 0.29); box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.29); width: 100%; } } .standalone-preview { .mobile-preview, .desktop-preview { margin-left: auto; margin-right: auto; } } .json-editor { margin: auto; max-width: 688px; } .perseus-json-editor { display: block; margin-left: auto; margin-right: auto; } .json-editor-warning { margin-bottom: 10px; text-align: center; } .bibliotron-article.framework-perseus.perseus-article { // Match Bibliotron's .box-sizing-border-box-reset, so that the Perseus // editor and webapp behave even more similarly. box-sizing: border-box; * { box-sizing: inherit; } } .perseus-editor-left-cell > .pod-title { // Make section header padding visually match widget editor header padding padding: 4px 9px; } } // // Button Group // .perseus-button-group { display: inline-block; & > button { background-color: white; border: 1px solid #ccc; border-bottom: 1px solid #ccc; border-left: 0; cursor: pointer; margin: 0; padding: 5px 10px; position: relative; // for hover &.selected { background-color: #ddd; } &:first-child { border-left: 1px solid #ccc; border-top-left-radius: 3px; border-bottom-left-radius: 3px; } &:last-child { border-right: 1px solid #ccc; border-top-right-radius: 3px; border-bottom-right-radius: 3px; } &:hover, &:focus { outline: 2px solid #999; outline-offset: -1px; z-index: 2; } } } // // More Options // .more-options-container { display: block; padding-bottom: 24px; position: relative; .more-options-title { border-radius: 0 0 @editorBorderRadius @editorBorderRadius; color: @gray; height: 20px; font-size: 14px; padding: 5px 0; width: @leftCellWidth - 2 * @editorBorderWidth; position: absolute; left: -1 * @editorPadding; right: 0; bottom: -1 * @editorPadding; text-align: center; &:hover { background-color: @grayLighter; cursor: pointer; } } } // // Expression editor // .perseus-widget-expression-editor { .answer-options-list li { margin: 5px 0; } .answer-status { color: inherit; cursor: pointer; display: inline-block; text-align: center; text-decoration: none; width: 75%; // TODO(joel) 60%? .user-select(none); &.wrong { background-color: @wrongRed; } &.correct { background-color: @correctGreen; } &.ungraded { background-color: @ungradedBlue; } } .expression-editor-h3 { margin: 10px 0 4px; } } // // Dropdown editor // .perseus-widget-dropdown { input[type=text] { border: 1px solid #ccc; border-radius: 5px; padding: 5px; &.correct { background: @correctGreen; } &.incorrect { background: @wrongRed; } } .dropdown-choices { margin: 20px 0; input[type="text"] { margin: 0 5px; width: 70%; } } .dropdown-info { float: left; } .dropdown-placeholder { float: right; } .remove-choice { margin-bottom: 10px; } } // // Input Number / Text Input // .perseus-input-number-editor { font-size: 14px; .ui-title, .msg-title { display: inline-block; text-align: center; } .ui-title { width: 100px; } .msg-title { margin-left: 5px; width: 230px; } .options-container { padding-left: 30px; } .input-answer-editor-value, .input-answer-editor-message { display: inline-block; } .input-answer-editor-value-container { border: @widgetBorder; border-radius: @widgetBorderRadius; float: left; .size(100px, 53px); overflow: hidden; position: relative; .numeric-input-value { border: 0; font-size: 13px; outline-offset: -3px; width: 100%; } &.with-max-error { .numeric-input-value { width: 60%; } } .max-error-container { display: inline-block; width: 40%; .max-error-plusmn { cursor: default; display: inline-block; width: 20%; } .number-input { border: 0; font-size: 13px; width: 80%; } } } .options-toggle, .answer-trash, .answer-status { height: 26px; line-height: 26px; outline-offset: -3px; vertical-align: middle; } .value-divider { border-top: @widgetBorder; } .options-toggle, .answer-trash { border-left: @widgetBorder; .border-box-sizing(); cursor: pointer; display: inline-block; text-align: center; text-decoration: none; width: 20%; } .options-toggle { background-color: #eee; color: #444; &:hover { background-color: #ccc; } } .answer-trash { background-color: #C04F03; background-image: linear-gradient(to bottom, #E35D04, #C04F03); color: #FFF; &:hover { color: #FFF; background-image: linear-gradient(to bottom, #F46E15, #D16014); } } .is-strict-indicator { background-color: @ungradedBlue; border-bottom: @widgetBorder; border-right: @widgetBorder; cursor: default; font-size: 16px; line-height: 12px; .size(12px, 12px); text-align: center; .position(absolute, 0, auto, auto, 0); .user-select(none); } .simplify-indicator { border-top: @widgetBorder; border-right: @widgetBorder; cursor: default; font-size: 10px; line-height: 13px; .size(12px, 13px); text-align: center; .position(absolute, 12px, auto, auto, 0); .user-select(none); &.optional { background-color: @correctGreen; } &.enforced { background-color: @wrongRed; } } .answer-status { color: inherit; display: inline-block; text-align: center; text-decoration: none; width: 60%; .user-select(none); &.wrong { background-color: @wrongRed; } &.correct { background-color: @correctGreen; } &.ungraded { background-color: @ungradedBlue; } } .input-answer-editor-message { margin-left: 5px; .perseus-single-editor{ font-family: 'Lucida Grande'; width: 230px; .perseus-textarea-pair > textarea, .perseus-textarea-underlay { padding: 5px; } .perseus-textarea-pair { border-color: @widgetBorderColor; border-radius: @editorBorderRadius; min-height: 53px; } .perseus-textarea-underlay { margin-bottom: 0; //override } } } } // // Radio editor / renderer // .perseus-widget-radio { margin-bottom: 10px; .choice-editor { .perseus-single-editor { margin-bottom: 0; } &.correct .DraftEditor-root, &.correct textarea { background: @correctGreen; } &.incorrect .DraftEditor-root, &.incorrect textarea { background: @wrongRed; } } textarea { // http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css &::-webkit-input-placeholder { color: #777; } &:-moz-placeholder { color: #777; opacity: 1; } &::-moz-placeholder { color: #777; opacity: 1; } &:-ms-input-placeholder { color: #777; } } .clue-editor { .perseus-textarea-pair { border-top: 0; } } .choice-clue-editors, .choice-editor, .clue-editor { display: inline-block; } .delete-choice { margin-left: 5px; padding: 5px; } .perseus-single-editor { border: 0; display: inline-block; margin: 0 0 5px; vertical-align: top; width: 280px; p {margin: 0;} } .perseus-textarea-pair, .perseus-textarea-underlay { display: block; } } .perseus-widget-radio .perseus-textarea-pair { & > textarea, > .perseus-textarea-underlay { padding: 5px; } } .perseus-widget-editor-content { .add-choice-container { .simple-button { margin-right: 10px; } } .perseus-widget-radio { position: static; .checkbox, .delete-choice { position: relative; top: -10px; } } .perseus-radio-option.none-of-above { &:before { content: 'None of the above'; display: block; font-style: italic; font-weight: bold; } .choice-editor.incorrect { opacity: 0.5; } } } #solutionarea .perseus-widget-radio li { padding: 7px 0; } // // Table of values editor // .framework-perseus table.perseus-widget-table-of-values { th { .perseus-single-editor { width: 80px; margin-bottom: 6px; } .perseus-textarea-pair, .perseus-single-editor { height: 50px; } } } // // Categorization Editor // .categorization-container.categorization-container-editor { @categoryWidth: 160px; width: 350px; margin-bottom: 160px; .card input { margin: 7px 3px 7px 13px; font-size: 12px; display: block; width: 81%; } .category { float: left; padding: 5px; width: @categoryWidth; } .categories { width: (@categoryWidth + 16px); } .perseus-textarea-underlay { margin-bottom: 0; } .drag-bar { float: left; font-size: 10px; padding: 2px 0; height: 70%; margin-top: 3px; } .header { margin-bottom: 8px; input { display: block; margin-right: 24px; width: 76%; } .remove { position: relative; top: -14px; left: 12px; float: right; width: 20px; height: 20px; padding: 2px; color: #666; &:hover { color: @grayDarker; } cursor: pointer; } } .delete-item-area { position: absolute; width: 150px; height: 60px; padding-top: 40px; bottom: -150px; left: 10px; border: dashed 2px #888; color: #888; &.target { border-color: black; color: @grayDarker; } text-align: center; font-size: 20px; } .card { width: (@categoryWidth - 30px); padding: 0; &.dragging .drag-bar { margin-left: 2px; } } } .categorization-editor-area { height: 30px; .add-item { float: left; margin-left: 17px; } .add-category { margin-left: 173px; } } // // Graph Editor // .perseus-widget-interactive-graph { display: block; } // // Plot Editor // .perseus-widget-plotter-editor { .plotter-categories, .pic-url { width: 70%; } } // // Text List Editors (Orderer, Matcher, Sorter) // .perseus-text-list-editor { input[type=text] { padding: 3px; margin-right: 5px; min-width: 20px; max-width: 340px; } &.layout-horizontal input[type=text] { float: left; } } .perseus-matcher-editor { .perseus-text-list-editor { float: left; max-width: 50%; input[type=text] { max-width: 90%; } } input[type=text] { width: 46%; } input[type=text] + input[type=text] { margin-left: 2%; } } // Info-tip lives in react-components but these styles are perseus-specific. .info-tip { display: inline-block; } .info-tip-content-container p { font-size: 12px; line-height: 1.4; margin: 0; } .info-tip-content-container p + p { margin-top: 22px; } .expression-answer-option { border: 1px solid #ddd; border-radius: 3px; .answer-handle { // textured draggy handle background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==) no-repeat 50% 50%; border-right: 1px solid #ddd; cursor: move; display: table-cell; width: 20px; } .answer-body { display: table-cell; } .answer-considered { display: table; } .answer-expression { display: table-cell; } .answer-status { display: table-cell; width: 100px; } .answer-option { padding-left: 5px; } .remove-container { padding: 5px; button { width: 100%; } } .perseus-math-input{ width: 236px; .mq-root-block { border-top: none; border-right: none; border-bottom: 1px solid #ddd !important; border-left: 1px solid #ddd !important; } } } // // Interaction Editor // .perseus-widget-interaction-editor { .perseus-widget-interaction-editor-select-element { background-color: #eee; border: 1px solid #ddd; border-top: 0; border-radius: 0 0 3px 3px; padding: 5px 10px; margin: 20px -11px -11px -11px; } .colorpicker-circle { border-radius: 50%; width: 14px; height: 14px; position: absolute; left: 5px; top: 5px; } } .perseus-interaction-element { border: @editorBorder; border-radius: @editorBorderRadius; .perseus-interaction-element-title { .pod-title; border: 0; color: inherit; display: block; text-decoration: none; white-space: nowrap; font-size: 1em; overflow: hidden; > svg { float: left; font-size: 14px; margin-right: 10px; } } .perseus-interaction-element-content { border-radius: 0 0 @editorBorderRadius @editorBorderRadius; border-top: @editorBorder; padding: @editorPadding; .edit-controls { text-align: right; margin-top: -30px; > button { background: #fff; border: 0; cursor: pointer; padding: 0; margin-left: 7px; font-size: 18px; color: #555; } } &.enter {} &.leave { display: none; } } } .button-set-label { display: block; } // Float the first one left because it has a suboption. // This is a minor hack. .button-set-label-float { display: block; float: left; margin-right: 10px; } .button-set-separator { margin: 10px 0; } // Don't allow selection on this label because I found it very easy to select // (don't know why...) which caused the selection to not actually be made. // I know this is autoprefixed in prod, but I want it to work in the perseus // repo. .show-div-button { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } // double selector for specificity .perseus-widget-editor .unit-radio { color: black; text-decoration: none; } .unit-example-not-okay { color: red; } .unit-example-okay { color: green; } .pair-editor input { width: 120px; } .marvel-device.iphone6.silver:after { z-index: 1; } .perseus-diff { @borderColor: #E4E4E4; margin: 0 10px; .diff-header { font-size: 18px; padding: 10px 0; width: 50%; display: inline-block; &.collapsed { font-size: 14px; padding: 0px; } } .diff-body { border-top: 1px solid @borderColor; border-bottom: 1px solid @borderColor; } .diff-row { width: 50%; white-space: pre-wrap; box-sizing: border-box; -moz-box-sizing: border-box; font-size: 14px; padding-right: 20px; padding-left: 10px; overflow: hidden; &.collapsed { color: #888; cursor: pointer; &:hover { color: #666; } &:active { color: #444; } } .diff-line { margin-bottom: 20px; } } .before { float: left; border-left: 1px solid @borderColor; } .after { float: right; border-right: 1px solid @borderColor; border-left: 1px solid @borderColor; } .inner-value { height: 100%; padding: 3px; } .not-present { display: none; } .blank-space { visibility: hidden; } .added { background-color: #EEFFEE; &.dark { background-color: #AAFFAA; } } .removed { background-color: #FFEEEE; &.dark { background-color: #FFAAAA; } } .image { display: inline-block; margin-left: 20px; margin-bottom: 10px; &, > div, > img { max-height: 300px; max-width: 100%; } } .image-unchanged { border: 1px solid #AAAAAA; } .image-added { border: 2px solid #AAFFAA; } .image-removed { border: 2px solid #FFAAAA; } .diff-separator { border-bottom: 1px dashed #444; margin: 30px 0 10px 0; } }