- Your HTML in
index.html
- Your CSS in
input.css
- Run CSS through process-css-demo via
build.sh
(or node) - Serve JS-supported styles
- ???
- Profit!
Notes:
import(`https://unpkg.com/cssomtools`).then(({process, property}) => { | |
const found = new Set | |
process( | |
[ | |
property('color', true), | |
property('background-color', true) | |
], | |
rule => { | |
if (rule.style.color) { |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title></title> | |
<body> | |
<input> | |
<script type=module> |
<input> | |
<textarea></textarea> | |
<style> | |
input { | |
--auto-expand: width; | |
} | |
textarea { | |
--auto-expand: height; | |
} |
var app = Application('System Events') | |
app.includeStandardAdditions = true | |
var browser = Application('Chrome').windows[0].activeTab() | |
// Chrome | |
browser.reload() | |
function loadEnd(callback) { | |
return browser.loading() | |
? loadEnd(callback) |
<custom-element></custom-element> | |
<custom-element-1></custom-element-1> | |
<custom-2-element></custom-2-element> | |
<custom-element-name></custom-element-name> | |
<custom-elementname></custom-elementname> | |
<style> | |
/* equals tag name */ | |
custom-element {} | |
const MO = new MutationObserver(processNodes) | |
function processNodes(entries) { | |
entries.forEach(({addedNodes}) => | |
Array.from(addedNodes) | |
.filter(node => node.matches && node.matches('div.zp-Zotpress')) | |
.forEach(node => node.textContent = node.textContent.replace('Available at:', '')) | |
) | |
} |
{ | |
let browser | |
let ua = navigator.userAgent | |
if (ua.includes('Edg')) { | |
browser = 'Edge' | |
} else if (ua.includes('Firefox')) { | |
browser = 'Firefox' | |
} else if (ua.includes('Safari')) { | |
browser = ua.includes('Chrome') ? 'Chrome' : 'Safari' |
index.html
input.css
build.sh
(or node)Notes:
CSS Object Notation
CSSON is a superset of JSON that is parsed according to CSS syntax.
Any JSON can be parsed as CSSON, though not every CSS Style Sheet can be parsed as CSSON.
Pros: