Skip to content

Instantly share code, notes, and snippets.

View squidfunk's full-sized avatar

Martin Donath squidfunk

View GitHub Profile
@squidfunk
squidfunk / the-cognitive-complexity-of-css.md
Last active July 19, 2024 12:15
The Cognitive Complexity of CSS (2020)

Although CSS has seen the light of the world [more than 20 years ago][1], it's still surprisingly under-researched. Our websites keep breaking in spectacular ways: visual inconsistencies caused by seemingly minor changes can go undetected for days, negatively impacting the user experience (UX), inducing customer churn and frustration, which can lead to lost opportunities. All too often, CSS is not perceived as a critical resource requiring proactive and deliberate care, but as an annoying necessity to advertise the brand to the consumer.

CSS is a very simple language: its [parsing][2] and [matching][3] semantics are incredibly easy to understand and implement. Moreover, it is very forgiving and

@squidfunk
squidfunk / get-lerna-packages.js
Last active December 2, 2021 10:24
Retrieve lerna packages programmatically
const { Project } = require("@lerna/project")
const packages = Project.getPackagesSync("path/to/lerna.json")
console.log(packages)
@squidfunk
squidfunk / twitter-detox.css
Last active October 27, 2021 14:30
Don't get sucked into Twitter (recommended extension: User CSS)
/* Hide menu items */
[aria-label^="Home"],
[aria-label^="Search"],
[aria-label^="Bookmarks"],
[aria-label^="Lists"],
[aria-label^="Timeline: Your Home"],
[data-testid^="AppTabBar_More_Menu"] {
display: none;
}
@squidfunk
squidfunk / pseudo-elements.md
Created September 18, 2020 14:29 — forked from alwayrun/pseudo-elements.md
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@squidfunk
squidfunk / proxylist.hidemyass.com.scraper.js
Last active May 22, 2022 21:40
A web scraper to obtain lists of anonymous proxies for web scraping
/*
* Copyright (c) 2016 Martin Donath
*
* All rights reserved. No part of this computer program(s) may be used,
* reproduced, stored in any retrieval system, or transmitted, in any form or
* by any means, electronic, mechanical, photocopying, recording, or otherwise
* without prior written permission.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.