From 143ab6960ca273a97f22175bc33bb981a915e73f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ca=C5=82ka?= Date: Mon, 5 Feb 2024 01:24:48 +0100 Subject: [PATCH] feat: improve styles on tag page and reformat --- .prettierrc.json | 15 ----- js/package-lock.json | 150 +++++++++++++++++++++++++++++++++++-------- js/package.json | 7 +- less/forum.less | 19 +++++- locale/en.yml | 6 +- 5 files changed, 148 insertions(+), 49 deletions(-) delete mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 773acba..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "printWidth": 150, - "singleQuote": true, - "tabWidth": 2, - "trailingComma": "es5", - "phpVersion": "7.4", - "overrides": [ - { - "files": "*.php", - "options": { - "tabWidth": 4 - } - } - ] -} diff --git a/js/package-lock.json b/js/package-lock.json index d2b539d..41a5a4b 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -7,10 +7,11 @@ "name": "@acpl/my-tags", "devDependencies": { "@flarum/prettier-config": "^1.0.0", - "@prettier/plugin-php": "^0.22.2", "flarum-tsconfig": "^1.0.2", "flarum-webpack-config": "^2.0.2", + "postcss": "^8.4.33", "prettier": "^3.2.5", + "prettier-plugin-css-order": "^2.0.1", "typescript": "^5.3.3", "typescript-coverage-report": "^0.8.0", "webpack": "^5.90.1", @@ -2043,19 +2044,6 @@ "integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==", "dev": true }, - "node_modules/@prettier/plugin-php": { - "version": "0.22.2", - "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.22.2.tgz", - "integrity": "sha512-md0+7tNbsP0oy+wIP3KZZc6fzx1k1jtWaMjOy/gM8yU9f2BDYEi+iHOc/UNPihYvPI28zFTbjvlhH4QXQjQwNg==", - "dev": true, - "dependencies": { - "linguist-languages": "^7.27.0", - "php-parser": "^3.1.5" - }, - "peerDependencies": { - "prettier": "^3.0.0" - } - }, "node_modules/@semantic-ui-react/event-stack": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@semantic-ui-react/event-stack/-/event-stack-3.1.3.tgz", @@ -2757,6 +2745,18 @@ "node": ">= 8" } }, + "node_modules/css-declaration-sorter": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-7.1.1.tgz", + "integrity": "sha512-dZ3bVTEEc1vxr3Bek9vGwfB5Z6ESPULhcRvO472mfjVnj8jRcTnKO8/JTczlvxM10Myb+wBM++1MtdO76eWcaQ==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss": "^8.0.9" + } + }, "node_modules/dayjs": { "version": "1.11.10", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", @@ -3613,12 +3613,6 @@ "node": ">=0.10.0" } }, - "node_modules/linguist-languages": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.27.0.tgz", - "integrity": "sha512-Wzx/22c5Jsv2ag+uKy+ITanGA5hzvBZngrNGDXLTC7ZjGM6FLCYGgomauTkxNJeP9of353OM0pWqngYA180xgw==", - "dev": true - }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -3778,6 +3772,24 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/ncp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", @@ -3929,12 +3941,6 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "node_modules/php-parser": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/php-parser/-/php-parser-3.1.5.tgz", - "integrity": "sha512-jEY2DcbgCm5aclzBdfW86GM6VEIWcSlhTBSHN1qhJguVePlYe28GhwS0yoeLYXpM2K8y6wzLwrbq814n2PHSoQ==", - "dev": true - }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -3976,6 +3982,72 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/postcss": { + "version": "8.4.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", + "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-less": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-less/-/postcss-less-6.0.0.tgz", + "integrity": "sha512-FPX16mQLyEjLzEuuJtxA8X3ejDLNGGEG503d2YGZR5Ask1SpDN8KmZUMpzCvyalWRywAn1n1VOA5dcqfCLo5rg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "postcss": "^8.3.5" + } + }, + "node_modules/postcss-scss": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.9.tgz", + "integrity": "sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss-scss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.4.29" + } + }, "node_modules/prettier": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", @@ -3991,6 +4063,23 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-css-order": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-css-order/-/prettier-plugin-css-order-2.0.1.tgz", + "integrity": "sha512-Y+wZ0wI7/qFUritirJksQn13KqbcNC3OZXSxGh1ui/X39hAeMW9md+Mp7fjk8H4ZQQ8c5CTYZxShoBfAal/79A==", + "dev": true, + "dependencies": { + "css-declaration-sorter": "^7.1.1", + "postcss-less": "^6.0.0", + "postcss-scss": "^4.0.3" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "prettier": "3.x" + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", @@ -4460,6 +4549,15 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", diff --git a/js/package.json b/js/package.json index 57c477d..166f72c 100644 --- a/js/package.json +++ b/js/package.json @@ -4,10 +4,11 @@ "prettier": "@flarum/prettier-config", "devDependencies": { "@flarum/prettier-config": "^1.0.0", - "@prettier/plugin-php": "^0.22.2", "flarum-tsconfig": "^1.0.2", "flarum-webpack-config": "^2.0.2", + "postcss": "^8.4.33", "prettier": "^3.2.5", + "prettier-plugin-css-order": "^2.0.1", "typescript": "^5.3.3", "typescript-coverage-report": "^0.8.0", "webpack": "^5.90.1", @@ -16,8 +17,8 @@ "scripts": { "dev": "webpack --mode development --watch", "build": "webpack --mode production", - "format": "prettier --write src", - "format-check": "prettier --check src", + "format": "prettier --write src ../less ../locale --plugin=prettier-plugin-css-order", + "format-check": "prettier --check src ../less ../locale --plugin=prettier-plugin-css-order", "analyze": "cross-env ANALYZER=true yarn run build", "clean-typings": "npx rimraf dist-typings && mkdir dist-typings", "build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings", diff --git a/less/forum.less b/less/forum.less index 14dd2a9..e97ebe3 100644 --- a/less/forum.less +++ b/less/forum.less @@ -8,22 +8,25 @@ .MyTags { p { - font-weight: 500; color: @muted-color; + font-weight: 500; } &__list { display: flex; flex-wrap: wrap; gap: 5px; + margin: 0; + padding: 0; + list-style: none; } @media @phone { padding: 15px 25px; p { - font-size: 16px; color: @text-color; + font-size: 16px; } &__list { @@ -35,3 +38,15 @@ } } } + +@media @desktop-up { + .TagsPage .sideNav .Dropdown-menu { + .MyTags { + padding-block: 8px; + + &__label { + display: none; + } + } + } +} diff --git a/locale/en.yml b/locale/en.yml index 2f4a6d9..f4647ec 100644 --- a/locale/en.yml +++ b/locale/en.yml @@ -1,9 +1,9 @@ acpl-my-tags: admin: settings: - enable-placeholder: 'Enable placeholder text when the user is not following any tags' + enable-placeholder: "Enable placeholder text when the user is not following any tags" forum: index: - my_tags: 'My tags' - placeholder: 'You are not following any tags yet. See tags' + my_tags: "My tags" + placeholder: "You are not following any tags yet. See tags"