fix: restore preview background to white (#36714)
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.enable-iframe {
|
||||
|
@ -9,7 +9,6 @@ import {
|
||||
} from 'lodash';
|
||||
|
||||
import { compileHeadTail, setExt, transformContents } from '../utils/polyvinyl';
|
||||
import { nightThemeStyle } from './displayStyle.js';
|
||||
|
||||
const htmlCatch = '\n<!--fcc-->\n';
|
||||
const jsCatch = '\n;/*fcc*/\n';
|
||||
@ -57,15 +56,8 @@ export const cssToHtml = cond([
|
||||
[stubTrue, identity]
|
||||
]);
|
||||
|
||||
export function concatHtml({
|
||||
required = [],
|
||||
template,
|
||||
files = [],
|
||||
theme = 'night'
|
||||
} = {}) {
|
||||
theme = theme === '' ? 'night' : theme;
|
||||
export function concatHtml({ required = [], template, files = [] } = {}) {
|
||||
const createBody = template ? _template(template) : defaultTemplate;
|
||||
const displayTheme = theme === 'night' ? nightThemeStyle : ` `;
|
||||
const head = required
|
||||
.map(({ link, src }) => {
|
||||
if (link && src) {
|
||||
@ -81,7 +73,7 @@ A required file can not have both a src and a link: src = ${src}, link = ${link}
|
||||
}
|
||||
return '';
|
||||
})
|
||||
.reduce((head, element) => head.concat(element), displayTheme);
|
||||
.reduce((head, element) => head.concat(element));
|
||||
|
||||
const source = files.reduce(
|
||||
(source, file) => source.concat(file.contents, htmlCatch),
|
||||
|
@ -1,10 +0,0 @@
|
||||
export const nightThemeStyle = `
|
||||
<style>
|
||||
html{
|
||||
color: white;
|
||||
}
|
||||
a {
|
||||
color: #99c9ff;
|
||||
}
|
||||
</style>
|
||||
`;
|
@ -15,7 +15,6 @@ import { createIdToNameMapSaga } from './id-to-name-map-saga';
|
||||
import { createExecuteChallengeSaga } from './execute-challenge-saga';
|
||||
import { createCurrentChallengeSaga } from './current-challenge-saga';
|
||||
import { challengeTypes } from '../../../../utils/challengeTypes';
|
||||
import { userSelector } from '../../../redux';
|
||||
|
||||
export const ns = 'challenge';
|
||||
export const backendNS = 'backendChallenge';
|
||||
@ -183,7 +182,6 @@ export const projectFormValuesSelector = state =>
|
||||
state[ns].projectFormValues || {};
|
||||
|
||||
export const challengeDataSelector = state => {
|
||||
const { theme } = userSelector(state);
|
||||
const { challengeType } = challengeMetaSelector(state);
|
||||
let challengeData = { challengeType };
|
||||
if (
|
||||
@ -225,7 +223,6 @@ export const challengeDataSelector = state => {
|
||||
template
|
||||
};
|
||||
}
|
||||
challengeData.theme = theme;
|
||||
return challengeData;
|
||||
};
|
||||
|
||||
|
@ -108,12 +108,7 @@ async function getDOMTestRunner(buildData, proxyLogger, document) {
|
||||
runTestInTestFrame(document, testString, testTimeout);
|
||||
}
|
||||
|
||||
export function buildDOMChallenge({
|
||||
files,
|
||||
required = [],
|
||||
template = '',
|
||||
theme = ``
|
||||
}) {
|
||||
export function buildDOMChallenge({ files, required = [], template = '' }) {
|
||||
const finalRequires = [...globalRequires, ...required, ...frameRunner];
|
||||
const loadEnzyme = Object.keys(files).some(key => files[key].ext === 'jsx');
|
||||
const toHtml = [jsToHtml, cssToHtml];
|
||||
@ -125,7 +120,7 @@ export function buildDOMChallenge({
|
||||
.then(checkFilesErrors)
|
||||
.then(files => ({
|
||||
challengeType: challengeTypes.html,
|
||||
build: concatHtml({ required: finalRequires, template, files, theme }),
|
||||
build: concatHtml({ required: finalRequires, template, files }),
|
||||
sources: buildSourceMap(files),
|
||||
loadEnzyme
|
||||
}));
|
||||
|
Reference in New Issue
Block a user