Merge pull request #3046 from dato/stylelint-fix

Remaining CSS lints and npm exec cleanup
This commit is contained in:
Mouse Reeve 2023-10-18 17:05:52 -07:00 committed by GitHub
commit caa31de685
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 65 additions and 64 deletions

View file

@ -1,4 +1,3 @@
@charset "utf-8"; @charset "utf-8";
@import "vendor/bulma/bulma";
@import "vendor/bulma/bulma.sass"; @import "bookwyrm/all";
@import "bookwyrm/all.scss";

View file

@ -16,9 +16,7 @@
@import "components/status"; @import "components/status";
@import "components/tabs"; @import "components/tabs";
@import "components/toggle"; @import "components/toggle";
@import "overrides/bulma_overrides"; @import "overrides/bulma_overrides";
@import "utilities/a11y"; @import "utilities/a11y";
@import "utilities/alignments"; @import "utilities/alignments";
@import "utilities/colors"; @import "utilities/colors";
@ -40,10 +38,12 @@ body {
width: 12px; width: 12px;
height: 12px; height: 12px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: $scrollbar-thumb; background: $scrollbar-thumb;
border-radius: 0.5em; border-radius: 0.5em;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: $scrollbar-track; background: $scrollbar-track;
} }
@ -89,7 +89,6 @@ button::-moz-focus-inner {
/** Utilities not covered by Bulma /** Utilities not covered by Bulma
******************************************************************************/ ******************************************************************************/
.tag.is-small { .tag.is-small {
height: auto; height: auto;
} }
@ -144,7 +143,6 @@ button.button-paragraph {
vertical-align: middle; vertical-align: middle;
} }
/** States /** States
******************************************************************************/ ******************************************************************************/
@ -159,7 +157,6 @@ button.button-paragraph {
cursor: not-allowed; cursor: not-allowed;
} }
/* Notifications page /* Notifications page
******************************************************************************/ ******************************************************************************/

View file

@ -43,7 +43,7 @@
max-height: 100%; max-height: 100%;
/* Useful when stretching under-sized images. */ /* Useful when stretching under-sized images. */
image-rendering: optimizeQuality; image-rendering: optimizequality;
image-rendering: smooth; image-rendering: smooth;
} }

View file

@ -30,20 +30,20 @@
} }
.copy-tooltip { .copy-tooltip {
overflow: visible; overflow: visible;
visibility: hidden; visibility: hidden;
width: 140px; width: 140px;
background-color: #555; background-color: #555;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 6px; border-radius: 6px;
padding: 5px; padding: 5px;
position: absolute; position: absolute;
z-index: 1; z-index: 1;
margin-left: -30px; margin-left: -30px;
margin-top: -45px; margin-top: -45px;
opacity: 0; opacity: 0;
transition: opacity 0.3s; transition: opacity 0.3s;
} }
.copy-tooltip::after { .copy-tooltip::after {
@ -54,5 +54,5 @@
margin-left: -60px; margin-left: -60px;
border-width: 5px; border-width: 5px;
border-style: solid; border-style: solid;
border-color: #555 transparent transparent transparent; border-color: #555 transparent transparent;
} }

View file

@ -44,12 +44,12 @@
.bw-tabs a:hover { .bw-tabs a:hover {
border-bottom-color: transparent; border-bottom-color: transparent;
color: $text color: $text;
} }
.bw-tabs a.is-active { .bw-tabs a.is-active {
border-bottom-color: transparent; border-bottom-color: transparent;
color: $link color: $link;
} }
.bw-tabs.is-left { .bw-tabs.is-left {

View file

@ -1,4 +1,4 @@
@import "../vendor/bulma/sass/utilities/initial-variables.sass"; @import "../vendor/bulma/sass/utilities/initial-variables";
/* Colors /* Colors
******************************************************************************/ ******************************************************************************/
@ -16,7 +16,7 @@ $danger-light: #481922;
$light: #393939; $light: #393939;
$red: #ffa1b4; $red: #ffa1b4;
$black: #000; $black: #000;
$white-ter: hsl(0, 0%, 90%); $white-ter: hsl(0deg, 0%, 90%);
/* book cover standins */ /* book cover standins */
$no-cover-color: #002549; $no-cover-color: #002549;
@ -79,7 +79,7 @@ $info-dark: #72b6ee;
} }
/* misc */ /* misc */
$shadow: 0 0.5em 0.5em -0.125em rgba($black, 0.2), 0 0px 0 1px rgba($black, 0.02); $shadow: 0 0.5em 0.5em -0.125em rgba($black, 0.2), 0 0 0 1px rgba($black, 0.02);
$card-header-shadow: 0 0.125em 0.25em rgba($black, 0.1); $card-header-shadow: 0 0.125em 0.25em rgba($black, 0.1);
$invisible-overlay-background-color: rgba($black, 0.66); $invisible-overlay-background-color: rgba($black, 0.66);
$progress-value-background-color: $border-light; $progress-value-background-color: $border-light;
@ -97,27 +97,23 @@ $family-secondary: $family-sans-serif;
color: $grey-light !important; color: $grey-light !important;
} }
.tabs li:not(.is-active) a { .tabs li:not(.is-active) a {
color: #2e7eb9 !important; color: #2e7eb9 !important;
} }
.tabs li:not(.is-active) a:hover {
.tabs li:not(.is-active) a:hover {
border-bottom-color: #2e7eb9 !important; border-bottom-color: #2e7eb9 !important;
}
.tabs li:not(.is-active) a {
color: #2e7eb9 !important;
} }
.tabs li.is-active a { .tabs li.is-active a {
color: #e6e6e6 !important; color: #e6e6e6 !important;
border-bottom-color: #e6e6e6 !important ; border-bottom-color: #e6e6e6 !important;
} }
#qrcode svg { #qrcode svg {
background-color: #a6a6a6; background-color: #a6a6a6;
} }
@import "../bookwyrm.scss"; @import "../bookwyrm";
@import "../vendor/icons.css"; @import "../vendor/icons.css";
@import "../vendor/shepherd.scss"; @import "../vendor/shepherd";

View file

@ -1,4 +1,4 @@
@import "../vendor/bulma/sass/utilities/derived-variables.sass"; @import "../vendor/bulma/sass/utilities/derived-variables";
/* Colors /* Colors
******************************************************************************/ ******************************************************************************/
@ -68,19 +68,16 @@ $family-secondary: $family-sans-serif;
.tabs li:not(.is-active) a { .tabs li:not(.is-active) a {
color: #3273dc !important; color: #3273dc !important;
} }
.tabs li:not(.is-active) a:hover {
border-bottom-color: #3273dc !important;
}
.tabs li:not(.is-active) a { .tabs li:not(.is-active) a:hover {
color: #3273dc !important; border-bottom-color: #3273dc !important;
} }
.tabs li.is-active a { .tabs li.is-active a {
color: #4a4a4a !important; color: #4a4a4a !important;
border-bottom-color: #4a4a4a !important ; border-bottom-color: #4a4a4a !important;
} }
@import "../bookwyrm";
@import "../bookwyrm.scss";
@import "../vendor/icons.css"; @import "../vendor/icons.css";
@import "../vendor/shepherd.scss"; @import "../vendor/shepherd";

18
bw-dev
View file

@ -188,27 +188,25 @@ case "$CMD" in
;; ;;
prettier) prettier)
prod_error prod_error
$DOCKER_COMPOSE run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js $DOCKER_COMPOSE run --rm dev-tools prettier --write bookwyrm/static/js/*.js
;; ;;
eslint) eslint)
prod_error prod_error
$DOCKER_COMPOSE run --rm dev-tools npx eslint bookwyrm/static --ext .js $DOCKER_COMPOSE run --rm dev-tools eslint bookwyrm/static --ext .js
;; ;;
stylelint) stylelint)
prod_error prod_error
$DOCKER_COMPOSE run --rm dev-tools npx stylelint \ $DOCKER_COMPOSE run --rm dev-tools stylelint --fix bookwyrm/static/css \
bookwyrm/static/css/bookwyrm.scss bookwyrm/static/css/bookwyrm/**/*.scss --fix \ --config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore
--config dev-tools/.stylelintrc.js
;; ;;
formatters) formatters)
prod_error prod_error
runweb pylint bookwyrm/ runweb pylint bookwyrm/
$DOCKER_COMPOSE run --rm dev-tools black celerywyrm bookwyrm $DOCKER_COMPOSE run --rm dev-tools black celerywyrm bookwyrm
$DOCKER_COMPOSE run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js $DOCKER_COMPOSE run --rm dev-tools prettier --write bookwyrm/static/js/*.js
$DOCKER_COMPOSE run --rm dev-tools npx eslint bookwyrm/static --ext .js $DOCKER_COMPOSE run --rm dev-tools eslint bookwyrm/static --ext .js
$DOCKER_COMPOSE run --rm dev-tools npx stylelint \ $DOCKER_COMPOSE run --rm dev-tools stylelint --fix bookwyrm/static/css \
bookwyrm/static/css/bookwyrm.scss bookwyrm/static/css/bookwyrm/**/*.scss --fix \ --config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore
--config dev-tools/.stylelintrc.js
;; ;;
mypy) mypy)
prod_error prod_error

View file

@ -1 +1,2 @@
**/vendor/** **/vendor/**
**/fonts/**

View file

@ -1,7 +1,7 @@
/* global module */ /* global module */
module.exports = { module.exports = {
"extends": "stylelint-config-standard", "extends": "stylelint-config-standard-scss",
"plugins": [ "plugins": [
"stylelint-order" "stylelint-order"
@ -18,5 +18,13 @@ module.exports = {
"declaration-block-no-redundant-longhand-properties": null, "declaration-block-no-redundant-longhand-properties": null,
"no-descending-specificity": null, "no-descending-specificity": null,
"alpha-value-notation": null "alpha-value-notation": null
} },
"overrides": [
{
"files": [ "../**/themes/bookwyrm-*.scss" ],
"rules": {
"no-invalid-position-at-import-rule": null
}
}
]
}; };

View file

@ -1,14 +1,17 @@
FROM python:3.9 FROM python:3.9
WORKDIR /app WORKDIR /app/dev-tools
ENV PATH="/app/dev-tools/node_modules/.bin:$PATH"
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
ENV NPM_CONFIG_UPDATE_NOTIFIER=false ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV PIP_ROOT_USER_ACTION=ignore PIP_DISABLE_PIP_VERSION_CHECK=1 ENV PIP_ROOT_USER_ACTION=ignore PIP_DISABLE_PIP_VERSION_CHECK=1
COPY nodejs.sources /etc/apt/sources.list.d/ COPY nodejs.sources /etc/apt/sources.list.d/
COPY package.json requirements.txt .stylelintrc.js .stylelintignore /app/ COPY package.json requirements.txt .stylelintrc.js .stylelintignore /app/dev-tools/
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y nodejs && \ apt-get install -y nodejs && \
pip install -r requirements.txt && \ pip install -r requirements.txt && \
npm install . npm install .
WORKDIR /app

View file

@ -11,6 +11,7 @@
"stylelint-config-recommended": "^7.0.0", "stylelint-config-recommended": "^7.0.0",
"stylelint-config-standard": "^25.0.0", "stylelint-config-standard": "^25.0.0",
"stylelint-order": "^5.0.0", "stylelint-order": "^5.0.0",
"stylelint-config-standard-scss": "^3.0.0",
"watch": "^0.13.0" "watch": "^0.13.0"
}, },
"dependencies": { "dependencies": {

View file

@ -101,6 +101,7 @@ services:
build: dev-tools build: dev-tools
env_file: .env env_file: .env
volumes: volumes:
- /app/dev-tools/
- .:/app - .:/app
volumes: volumes:
pgdata: pgdata: