progress on migrating to heex templates and font-icons

This commit is contained in:
Adam Piontek 2022-08-13 07:32:36 -04:00
parent d43daafdb7
commit 3eff955672
21793 changed files with 2161968 additions and 16895 deletions
assets_old/node_modules/postcss-modules-values

View file

@ -0,0 +1,55 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [4.0.0](https://github.com/postcss-modules-local-by-default/compare/v4.0.0-rc.5...v4.0.0) - 2020-13-08
### Fixes
- compatibility with other plugins
## [4.0.0-rc.5](https://github.com/postcss-modules-local-by-default/compare/v4.0.0-rc.4...v4.0.0-rc.5) - 2020-11-08
### Fixes
- compatibility with other plugins
## [4.0.0-rc.4](https://github.com/postcss-modules-local-by-default/compare/v4.0.0-rc.3...v4.0.0-rc.4) - 2020-10-08
### Fixes
- perf
- compatibility with empty custom properties
- works with `options.createImportedName`
## [4.0.0-rc.3](https://github.com/postcss-modules-local-by-default/compare/v4.0.0-rc.2...v4.0.0-rc.3) - 2020-10-08
### BREAKING CHANGE
- minimum supported `postcss` version is `^8.1.0`
### Fixes
- minimum supported `Node.js` version is `^10 || ^12 || >= 14`
- compatibility with PostCSS 8
## [4.0.0-rc.2](https://github.com/postcss-modules-local-by-default/compare/v4.0.0-rc.1...v4.0.0-rc.2) - 2020-09-22
### Fixes
- avoid using `postcss` directly to create decls and rules
## [4.0.0-rc.1](https://github.com/postcss-modules-local-by-default/compare/v4.0.0-rc.0...v4.0.0-rc.1) - 2020-09-22
### BREAKING CHANGE
- update `icss-utils` for PostCSS 8 compatibility
## [4.0.0-rc.0](https://github.com/postcss-modules-local-by-default/compare/v3.0.0...v4.0.0-rc.1) - 2020-09-18
### BREAKING CHANGE
- minimum supported `Node.js` version is `>= 10.13.0 || >= 12.13.0 || >= 14`
- minimum supported `postcss` version is `^8.0.3`
- `postcss` was moved to `peerDependencies`, you need to install `postcss` in your project before use the plugin

View file

@ -0,0 +1,7 @@
ISC License (ISC)
Copyright (c) 2015, Glen Maddern
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,80 @@
# CSS Modules: Values
Pass arbitrary values between your module files
### Usage
```css
/* colors.css */
@value primary: #BF4040;
@value secondary: #1F4F7F;
.text-primary {
color: primary;
}
.text-secondary {
color: secondary;
}
```
```css
/* breakpoints.css */
@value small: (max-width: 599px);
@value medium: (min-width: 600px) and (max-width: 959px);
@value large: (min-width: 960px);
```
```css
/* my-component.css */
/* alias paths for other values or composition */
@value colors: "./colors.css";
/* import multiple from a single file */
@value primary, secondary from colors;
/* make local aliases to imported values */
@value small as bp-small, large as bp-large from "./breakpoints.css";
/* value as selector name */
@value selectorValue: secondary-color;
.selectorValue {
color: secondary;
}
.header {
composes: text-primary from colors;
box-shadow: 0 0 10px secondary;
}
@media bp-small {
.header {
box-shadow: 0 0 4px secondary;
}
}
@media bp-large {
.header {
box-shadow: 0 0 20px secondary;
}
}
```
**If you are using Sass** along with this PostCSS plugin, do not use the colon `:` in your `@value` definitions. It will cause Sass to crash.
Note also you can _import_ multiple values at once but can only _define_ one value per line.
```css
@value a: b, c: d; /* defines a as "b, c: d" */
```
## License
ISC
## With thanks
- Mark Dalgleish
- Tobias Koppers
- Josh Johnston
---
Glen Maddern, 2015.

View file

@ -0,0 +1,54 @@
{
"name": "postcss-modules-values",
"version": "4.0.0",
"description": "PostCSS plugin for CSS Modules to pass arbitrary values between your module files",
"main": "src/index.js",
"files": [
"src"
],
"engines": {
"node": "^10 || ^12 || >= 14"
},
"scripts": {
"prettier": "prettier -l --ignore-path .gitignore .",
"eslint": "eslint --ignore-path .gitignore .",
"lint": "yarn eslint && yarn prettier",
"test:only": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage --collectCoverageFrom=\"src/**/*\"",
"pretest": "yarn lint",
"test": "yarn test:coverage",
"prepublishOnly": "yarn test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/css-modules/postcss-modules-values.git"
},
"keywords": [
"css",
"modules",
"postcss"
],
"author": "Glen Maddern",
"license": "ISC",
"bugs": {
"url": "https://github.com/css-modules/postcss-modules-values/issues"
},
"homepage": "https://github.com/css-modules/postcss-modules-values#readme",
"devDependencies": {
"coveralls": "^3.1.0",
"eslint": "^7.10.0",
"eslint-config-prettier": "^6.12.0",
"husky": "^4.3.0",
"jest": "^26.5.2",
"lint-staged": "^10.4.0",
"postcss": "^8.1.0",
"prettier": "^2.1.2"
},
"dependencies": {
"icss-utils": "^5.0.0"
},
"peerDependencies": {
"postcss": "^8.1.0"
}
}

View file

@ -0,0 +1,142 @@
"use strict";
const ICSSUtils = require("icss-utils");
const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;
const matchValueDefinition = /(?:\s+|^)([\w-]+):?(.*?)$/;
const matchImport = /^([\w-]+)(?:\s+as\s+([\w-]+))?/;
module.exports = (options) => {
let importIndex = 0;
const createImportedName =
(options && options.createImportedName) ||
((importName /*, path*/) =>
`i__const_${importName.replace(/\W/g, "_")}_${importIndex++}`);
return {
postcssPlugin: "postcss-modules-values",
prepare(result) {
const importAliases = [];
const definitions = {};
return {
Once(root, postcss) {
root.walkAtRules(/value/i, (atRule) => {
const matches = atRule.params.match(matchImports);
if (matches) {
let [, /*match*/ aliases, path] = matches;
// We can use constants for path names
if (definitions[path]) {
path = definitions[path];
}
const imports = aliases
.replace(/^\(\s*([\s\S]+)\s*\)$/, "$1")
.split(/\s*,\s*/)
.map((alias) => {
const tokens = matchImport.exec(alias);
if (tokens) {
const [, /*match*/ theirName, myName = theirName] = tokens;
const importedName = createImportedName(myName);
definitions[myName] = importedName;
return { theirName, importedName };
} else {
throw new Error(`@import statement "${alias}" is invalid!`);
}
});
importAliases.push({ path, imports });
atRule.remove();
return;
}
if (atRule.params.indexOf("@value") !== -1) {
result.warn("Invalid value definition: " + atRule.params);
}
let [, key, value] = `${atRule.params}${atRule.raws.between}`.match(
matchValueDefinition
);
const normalizedValue = value.replace(/\/\*((?!\*\/).*?)\*\//g, "");
if (normalizedValue.length === 0) {
result.warn("Invalid value definition: " + atRule.params);
atRule.remove();
return;
}
let isOnlySpace = /^\s+$/.test(normalizedValue);
if (!isOnlySpace) {
value = value.trim();
}
// Add to the definitions, knowing that values can refer to each other
definitions[key] = ICSSUtils.replaceValueSymbols(
value,
definitions
);
atRule.remove();
});
/* If we have no definitions, don't continue */
if (!Object.keys(definitions).length) {
return;
}
/* Perform replacements */
ICSSUtils.replaceSymbols(root, definitions);
/* We want to export anything defined by now, but don't add it to the CSS yet or it well get picked up by the replacement stuff */
const exportDeclarations = Object.keys(definitions).map((key) =>
postcss.decl({
value: definitions[key],
prop: key,
raws: { before: "\n " },
})
);
/* Add export rules if any */
if (exportDeclarations.length > 0) {
const exportRule = postcss.rule({
selector: ":export",
raws: { after: "\n" },
});
exportRule.append(exportDeclarations);
root.prepend(exportRule);
}
/* Add import rules */
importAliases.reverse().forEach(({ path, imports }) => {
const importRule = postcss.rule({
selector: `:import(${path})`,
raws: { after: "\n" },
});
imports.forEach(({ theirName, importedName }) => {
importRule.append({
value: theirName,
prop: importedName,
raws: { before: "\n " },
});
});
root.prepend(importRule);
});
},
};
},
};
};
module.exports.postcss = true;