I hereby claim:
- I am tomhodgins on github.
- I am innovati (https://keybase.io/innovati) on keybase.
- I have a public key ASDaQPqJ4vThxJOg4WZ1Tg33xT_M_TNVDeQfOORLLPD51go
To claim this, I am signing this object:
// List all media query breakpoints | |
import('https://unpkg.com/cssomtools').then(({process, query}) => { | |
const found = new Set | |
process( | |
query(), | |
rule => { | |
if ( | |
rule.media | |
&& rule.media.mediaText |
document.documentElement.textContent // Get all of the text content on the web page. | |
.replace(/\b(\s*\[at\]\s*)\b/g, '@') // Replace any ' [at] ' with '@'. | |
.split(/\s+/) // Split text content by whitespace between words. | |
.filter(Boolean) // Eliminate any empty words. | |
.filter(string => { // Filter list of words: | |
const input = document.createElement('input') // by creating an <input> element, | |
input.type = 'email' // setting the input type to email, | |
input.value = string.trim() // setting its value to the current word, | |
return input.checkValidity() // and checking if it's a valid email address. | |
}) // Result: a list of all valid emails on the page. |
import {parse} from 'https://unpkg.com/cssomtools' | |
function CSSUnescape(string = '') { | |
return JSON.parse( | |
parse(` | |
::-webkit-custom-pseudo { | |
content: "${string}"; | |
} | |
`).cssRules[0].style.getPropertyValue('content') | |
) |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>CSS Dependency Resolver Demo</title> | |
<h1>CSS Dependency Resolver</h1> | |
<style> | |
@supports (--dependencies(url(https://csspl.us/cursory.js))) { | |
* { |
@--reset test-9; | |
.up-modal { | |
z-index: 9999999; | |
} | |
test-9 { | |
display: flex; | |
flex-direction: column; | |
align-items: center; |
const babel = require('@babel/core') | |
const fs = require('fs') | |
let file = process.argv.slice(2)[0] | |
let text = file | |
if (fs.existsSync(file)) { | |
text = fs.readFileSync(file).toString() | |
} |
import * as parseCSS from 'https://tomhodgins.github.io/parse-css/index.js' | |
const css = parseCSS.parseAComponentValue( | |
Deno.args[1].trim() | |
) | |
if ( | |
css.type === 'FUNCTION' | |
&& css.name.match(/rgba?/) | |
) { |
I hereby claim:
To claim this, I am signing this object:
// deno nesting-deno.js 'a { color: red; ---\ b: { color: green }; }' | |
// deno nesting-deno.js --allow-read path/to/stylesheet.css | |
import * as parseCSS from 'https://tomhodgins.github.io/parse-css/index.js' | |
let file = Deno.args.slice(1)[0] | |
let css = file | |
try { | |
Deno.statSync(file) | |
css = new TextDecoder('utf-8').decode( |
/* Min-width */ | |
.minwidth::observer { | |
observe-resize-width: 300 medium; | |
} | |
.minwidth:observe(resize-width medium) { | |
border-color: limegreen; | |
background: greenyellow; | |
} |