Skip to content
Snippets Groups Projects
Commit 5f6d2f5c authored by Harumi Jang's avatar Harumi Jang
Browse files

Better naming for print statements

parent 625afaa2
No related branches found
No related tags found
No related merge requests found
......@@ -52,3 +52,8 @@ sup {
.cm-theme-light {
width: 50%;
}
.test-button {
margin-top: 20px;
display: flex;
}
......@@ -45,7 +45,7 @@ export default function StylePanel(props) {
visit: 'Atrule',
enter: (node) => {
if (node.name === 'media') {
console.log('TEST PARSING @MEDIA', csstree.generate(node));
console.log('Test for @media:', csstree.generate(node));
}
},
});
......@@ -55,7 +55,7 @@ export default function StylePanel(props) {
visit: 'Rule',
enter: (node) => {
if (csstree.generate(node.prelude) === '.card h2') {
console.log('TEST PARSING NESTED', csstree.generate(node));
console.log('Test for nested:', csstree.generate(node));
}
},
});
......@@ -68,7 +68,7 @@ export default function StylePanel(props) {
if (selector.includes(':hover') && node.block.children.some(child => child.property === 'color')) {
node.block.children.forEach(child => {
if (child.property === 'color') {
console.log('TEST PARSING :HOVER', csstree.generate(child.value)); // This will print 'yellow'
console.log('Test :hover:', csstree.generate(child.value)); // This will print 'yellow'
}
});
}
......@@ -82,7 +82,7 @@ export default function StylePanel(props) {
const selector = csstree.generate(node.prelude);
if (selector.includes('::before')) {
node.block.children.forEach(child => {
console.log('TEST PARSING ::before', csstree.generate(child.value));
console.log('Test ::before:', csstree.generate(child.value));
});
}
},
......@@ -93,7 +93,7 @@ export default function StylePanel(props) {
visit: 'Declaration',
enter: (node) => {
if (node.property === 'animation' || node.property === 'animation-name') {
console.log('Animation Declaration:', csstree.generate(node));
console.log('Test animation:', csstree.generate(node));
}
},
});
......@@ -106,7 +106,7 @@ export default function StylePanel(props) {
csstree.walk(node, {
visit: 'Declaration',
enter: (keyframeNode) => {
console.log('Keyframe:', csstree.generate(keyframeNode));
console.log('Test keyframes:', csstree.generate(keyframeNode));
},
});
}
......@@ -118,13 +118,13 @@ export default function StylePanel(props) {
return (
<div className="style-panel">
{/*<div>{style}</div>*/}
<h2>Style panel (UI)</h2>
<button onClick={testComplexCSSParsing}>Test button for parsing complex css</button>
<label htmlFor="myInput">Margin left:
<input id="myInput" type="text" value={marginLeft}
onChange={(e) => onChangeHandler(e)}/>
<input id="myInput" type="text" value={marginLeft}
onChange={(e) => onChangeHandler(e)}/>
</label>
<button className="test-button" onClick={testComplexCSSParsing}>Click to print parsed results from css
</button>
</div>
);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment