diff --git a/package-lock.json b/package-lock.json index 167536b..12e46f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "@alaskaairux/auro-header", - "version": "1.5.3", + "name": "@aurodesignsystem/auro-header", + "version": "1.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@alaskaairux/auro-header", - "version": "1.5.3", + "name": "@aurodesignsystem/auro-header", + "version": "1.5.4", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -48,10 +48,7 @@ "nodemon": "^2.0.13", "npm-run-all": "^4.1.5", "postcss": "^8.3.8", - "postcss-custom-properties": "^11.0.0", "postcss-discard-comments": "^4.0.2", - "postcss-rem-to-pixel": "^4.1.2", - "postcss-remove-rules": "^1.0.0", "postcss-selector-replace": "^1.0.2", "rollup": "^2.57.0", "rollup-plugin-serve": "^1.1.0", @@ -8724,27 +8721,6 @@ "node": ">= 0.4.0" } }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -9792,18 +9768,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-url-superb": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", - "integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -9989,12 +9953,6 @@ "node": ">= 0.6.0" } }, - "node_modules/js-base64": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", - "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", - "dev": true - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -16242,21 +16200,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/postcss-custom-properties": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-11.0.0.tgz", - "integrity": "sha512-Fhnx/QLt+CTt23A/KKVx1anZD9nmVpOxKCKv5owWacMoOsBXFhMAD6SZYbmPMH4nHdIeMUnWOvLZnlY4niS0sA==", - "dev": true, - "dependencies": { - "postcss-values-parser": "^4.0.0" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, "node_modules/postcss-discard-comments": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz", @@ -16364,243 +16307,6 @@ "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==", "dev": true }, - "node_modules/postcss-rem-to-pixel": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/postcss-rem-to-pixel/-/postcss-rem-to-pixel-4.1.2.tgz", - "integrity": "sha512-EaA1Ak5SxmT31KA1clM4jRcEXQQ7oceXM2WF59fJw/mhspn1fhm202ZIfto5qFCX4QVuk/WVvATfkWaIlMomSw==", - "dev": true, - "dependencies": { - "object-assign": "^4.1.0", - "postcss": "^5.2.10" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/chalk/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "dependencies": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-rem-to-pixel/node_modules/supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", - "dev": true, - "dependencies": { - "has-flag": "^1.0.0" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/postcss-remove-rules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postcss-remove-rules/-/postcss-remove-rules-1.0.0.tgz", - "integrity": "sha512-eQHFhEwYjeJAWJgMmoviC9E4HxLYivGEux7GbgU0IdBS7G9zSOjd0RLFIEGa5Lx0wL17pEWWPVlekGuIo4mcfg==", - "dev": true, - "dependencies": { - "postcss": "^5.0.21" - } - }, - "node_modules/postcss-remove-rules/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-remove-rules/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-remove-rules/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-remove-rules/node_modules/chalk/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/postcss-remove-rules/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/postcss-remove-rules/node_modules/has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-remove-rules/node_modules/postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "dependencies": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/postcss-remove-rules/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-remove-rules/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss-remove-rules/node_modules/supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", - "dev": true, - "dependencies": { - "has-flag": "^1.0.0" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/postcss-resolve-nested-selector": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", @@ -16871,52 +16577,6 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, - "node_modules/postcss-values-parser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-4.0.0.tgz", - "integrity": "sha512-R9x2D87FcbhwXUmoCXJR85M1BLII5suXRuXibGYyBJ7lVDEpRIdKZh4+8q5S+/+A4m0IoG1U5tFw39asyhX/Hw==", - "dev": true, - "dependencies": { - "color-name": "^1.1.4", - "is-url-superb": "^4.0.0", - "postcss": "^7.0.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/postcss-values-parser/node_modules/picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true - }, - "node_modules/postcss-values-parser/node_modules/postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "dev": true, - "dependencies": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - } - }, - "node_modules/postcss-values-parser/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", diff --git a/package.json b/package.json index 73df662..a18aa09 100644 --- a/package.json +++ b/package.json @@ -65,10 +65,7 @@ "nodemon": "^2.0.13", "npm-run-all": "^4.1.5", "postcss": "^8.3.8", - "postcss-custom-properties": "^11.0.0", "postcss-discard-comments": "^4.0.2", - "postcss-rem-to-pixel": "^4.1.2", - "postcss-remove-rules": "^1.0.0", "postcss-selector-replace": "^1.0.2", "rollup": "^2.57.0", "rollup-plugin-serve": "^1.1.0", diff --git a/scripts/postCss.js b/scripts/postCss.js index 52980fe..42d2d09 100644 --- a/scripts/postCss.js +++ b/scripts/postCss.js @@ -1,53 +1,20 @@ const autoprefixer = require('autoprefixer'); const postcss = require('postcss'); -const remToPx = require('postcss-rem-to-pixel'); -const removeNonRem = require('./removeNonRemPlugin.js'); -const postcssCustomProperties = require('postcss-custom-properties'); -const removeRules = require('postcss-remove-rules'); const comments = require('postcss-discard-comments'); const fs = require('fs'); fs.readFile('src/style.css', (err, css) => { - postcss([autoprefixer, postcssCustomProperties, comments]) + postcss([autoprefixer, comments]) .use(comments({ - remove: function(comment) { return comment[0] == "@"; } - })) - .use(removeRules({ - rulesToRemove: { - ':root': '*' + remove(comment) { + return comment[0] == "@"; } })) .process(css, { from: 'src/style.css', to: 'src/style.css' }) - .then(result => { + .then((result) => { fs.writeFile('src/style.css', result.css, () => true) - if ( result.map ) { + if (result.map) { fs.writeFile('src/style.map', result.map, () => true) } }) }); - -/* -Output a "fixed" stylesheet that only contains declarations with rem units -converted to their px equivalent. -*/ -const fixedFile = 'src/style-fixed.css'; -const fixedFileMap = 'src/style-fixed.map'; -fs.readFile(fixedFile, (err, css) => { - postcss([ - autoprefixer, - postcssCustomProperties({preserve: false}), - comments, - removeNonRem, - remToPx({replace: true, propList: ['*']}) - ]) - .use(comments({ - remove: function(comment) { return comment[0] == "@"; } - })) - .process(css, { from: fixedFile, to: fixedFile }) - .then(result => { - fs.writeFile(fixedFile, result.css, () => true) - if ( result.map ) { - fs.writeFile(fixedFileMap, result.map, () => true) - } - }) -}); diff --git a/scripts/removeNonRemPlugin.js b/scripts/removeNonRemPlugin.js deleted file mode 100644 index 27e591a..0000000 --- a/scripts/removeNonRemPlugin.js +++ /dev/null @@ -1,29 +0,0 @@ -const postcss = require('postcss'); - -const customPropertyRegExp = /^--[A-z][\w-]*$/; -// Remove all declarations that do not contain rems -module.exports = postcss.plugin('remove-non-rem', function (opts) { - opts = opts || {}; - - return function (css) { - css.walkDecls(decl => { - if (!decl.value.includes('rem') || customPropertyRegExp.test(decl.prop)) { - decl.remove(); - } - }); - - css.walkRules(rule => { - if (rule.nodes.length == 0) { - rule.remove(); - } - }); - - css.walkAtRules(rule => { - if (rule.nodes.length == 0) { - rule.remove(); - } - }); - - css.wa - }; -}); diff --git a/src/auro-header.js b/src/auro-header.js index e249a83..13f974b 100644 --- a/src/auro-header.js +++ b/src/auro-header.js @@ -9,7 +9,6 @@ import { ifDefined } from 'lit/directives/if-defined.js'; // Import touch detection lib import "focus-visible/dist/focus-visible.min.js"; import styleCss from "./style-css.js"; -import styleCssFixed from './style-fixed-css.js'; /** * auro-header is a custom element to make using headers with the Auro Design System seamless and easy. @@ -44,10 +43,7 @@ export class AuroHeader extends LitElement { } static get styles() { - return [ - styleCss, - styleCssFixed - ] + return [styleCss] } /** @@ -122,8 +118,7 @@ export class AuroHeader extends LitElement { } } -/* istanbul ignore else */ -// define the name of the custom component +// default internal definition if (!customElements.get("auro-header")) { customElements.define("auro-header", AuroHeader); }