UNPKG

@instructure/quiz-interactions

Version:

A React UI component Library for quiz interaction types.

65 lines (64 loc) 2.25 kB
function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _object_spread(target) { for(var i = 1; i < arguments.length; i++){ var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function(key) { _define_property(target, key, source[key]); }); } return target; } var generateStyle = function(componentTheme, props) { return { blankScreenReaderContentWrapper: { display: 'inline-block' }, '[contenteditable=true]:empty::before': { content: 'attr(placeholder)', color: componentTheme.tableColor, cursor: 'text' }, editableText: _object_spread({ color: componentTheme.editStemColor, display: 'inline-block', fontFamily: componentTheme.editStemFontFamily, fontSize: componentTheme.editStemFontSize, fontWeight: componentTheme.editStemFontWeight, lineHeight: componentTheme.editStemLineHeight, whiteSpace: 'pre-wrap', '&:focus': { outline: '0 none' } }, props.stemItems.length <= 1 && { width: '100%' }), highlight: { border: "".concat(componentTheme.highlightBorder, " solid ").concat(componentTheme.highlightColor), borderRadius: componentTheme.highlightBorderRadius, padding: componentTheme.highlightPadding, position: 'relative', marginLeft: componentTheme.highlightMargin, marginRight: componentTheme.highlightMargin, wordWrap: 'break-word' } }; }; export default generateStyle;