Skip to content

Instantly share code, notes, and snippets.

View thejettdurham's full-sized avatar

Jett Durham thejettdurham

  • Wichita, KS
View GitHub Profile
@kristojorg
kristojorg / styled-specificity-codemod.js
Last active February 9, 2022 12:08
A codemod to add specificity to styled-components generated css. This helped me fix the issue of jss being placed in the head below styled-components
const tagTypes = {
Identifier: node => node,
CallExpression: node => node.callee,
MemberExpression: node => node.object,
};
module.exports = (file, api, options) => {
const j = api.jscodeshift;
const ast = j(file.source);