From 4a6f797e480ff918cad7a93a331e48b45df091dc Mon Sep 17 00:00:00 2001 From: Tom Carrick Date: Sat, 18 Apr 2026 14:12:44 +0300 Subject: [PATCH 1/4] Refs #35007 -- Added biome to lint and format CSS files. --- .editorconfig | 8 ++++---- .github/workflows/linters.yml | 17 ++++++++++++++++ .pre-commit-config.yaml | 5 +++++ biome.json | 37 +++++++++++++++++++++++++++++++++++ package.json | 4 +++- 5 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 biome.json diff --git a/.editorconfig b/.editorconfig index f5a029187c31..e25596d077bf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,13 +19,13 @@ max_line_length = 88 indent_size = 2 [**/admin/js/vendor/**] -indent_style = ignore -indent_size = ignore +indent_style = unset +indent_size = unset # Minified JavaScript files shouldn't be changed [**.min.js] -indent_style = ignore -insert_final_newline = ignore +indent_style = unset +insert_final_newline = unset # Makefiles always use tabs for indentation [Makefile] diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index e37d7b5ee221..ccee1adde022 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -83,3 +83,20 @@ jobs: with: advanced-security: false annotations: true + + biome: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Set up Node.js + uses: actions/setup-node@v5 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: '**/package.json' + - run: npm install + - run: npx biome ci diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dbe92a2bdc39..bc7a5c279a0b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,6 +24,11 @@ repos: rev: v9.39.1 hooks: - id: eslint + - repo: https://github.com/biomejs/pre-commit + rev: v2.4.12 + hooks: + - id: biome-check + additional_dependencies: ["@biomejs/biome@2.4.12"] - repo: https://github.com/zizmorcore/zizmor-pre-commit rev: v1.19.0 hooks: diff --git a/biome.json b/biome.json new file mode 100644 index 000000000000..cc95757f3efe --- /dev/null +++ b/biome.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.4.12/schema.json", + "files": { + "includes": [ + "django/contrib/admin/static/admin/css/**/*.css", + "!django/contrib/admin/static/admin/css/vendor/**", + "django/contrib/gis/static/gis/css/**/*.css", + "docs/_theme/**/*.css", + "!docs/_theme/djangodocs/static/fontawesome/**", + "!docs/_theme/djangodocs/static/reset-fonts-grids.css", + "!**/*.min.css" + ] + }, + "formatter": { + "enabled": true, + "useEditorconfig": true + }, + "linter": { + "enabled": true, + "rules": { + "complexity": { + "noImportantStyles": "off" + }, + "style": { + "noDescendingSpecificity": "off" + } + } + }, + "javascript": { + "linter": { "enabled": false }, + "formatter": { "enabled": false } + }, + "json": { + "linter": { "enabled": false }, + "formatter": { "enabled": false } + } +} diff --git a/package.json b/package.json index a0ae4ad873f7..e1d22cda119f 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,14 @@ "private": true, "scripts": { "pretest": "eslint .", - "test": "grunt test --verbose" + "test": "grunt test --verbose", + "biome": "biome check" }, "engines": { "npm": ">=1.3.0" }, "devDependencies": { + "@biomejs/biome": "^2.4.12", "eslint": "^9.39.1", "puppeteer": "^24.22.0", "grunt": "^1.6.1", From 241b8e1aab7fc71018a059467b2ba17bce6556cc Mon Sep 17 00:00:00 2001 From: Tom Carrick Date: Sat, 18 Apr 2026 14:13:27 +0300 Subject: [PATCH 2/4] Formatted CSS files. --- .../admin/static/admin/css/autocomplete.css | 192 ++++-- .../contrib/admin/static/admin/css/base.css | 277 +++++--- .../admin/static/admin/css/changelists.css | 23 +- .../admin/static/admin/css/dark_mode.css | 83 ++- .../admin/static/admin/css/dashboard.css | 5 +- .../contrib/admin/static/admin/css/forms.css | 36 +- .../contrib/admin/static/admin/css/login.css | 3 +- .../admin/static/admin/css/nav_sidebar.css | 7 +- .../admin/static/admin/css/responsive.css | 118 ++-- .../admin/static/admin/css/responsive_rtl.css | 8 +- django/contrib/admin/static/admin/css/rtl.css | 40 +- .../admin/css/unusable_password_field.css | 6 +- .../admin/static/admin/css/widgets.css | 105 ++- docs/_theme/djangodocs-epub/static/epub.css | 69 +- .../_theme/djangodocs/static/console-tabs.css | 38 +- docs/_theme/djangodocs/static/djangodocs.css | 613 ++++++++++++++---- docs/_theme/djangodocs/static/homepage.css | 48 +- 17 files changed, 1209 insertions(+), 462 deletions(-) diff --git a/django/contrib/admin/static/admin/css/autocomplete.css b/django/contrib/admin/static/admin/css/autocomplete.css index 7478c2c4e6ce..8325f9a35eee 100644 --- a/django/contrib/admin/static/admin/css/autocomplete.css +++ b/django/contrib/admin/static/admin/css/autocomplete.css @@ -12,19 +12,25 @@ select.admin-autocomplete { padding: 0; } -.select2-container--admin-autocomplete.select2-container--focus .select2-selection, -.select2-container--admin-autocomplete.select2-container--open .select2-selection { +.select2-container--admin-autocomplete.select2-container--focus + .select2-selection, +.select2-container--admin-autocomplete.select2-container--open + .select2-selection { border-color: var(--body-quiet-color); min-height: 30px; } -.select2-container--admin-autocomplete.select2-container--focus .select2-selection.select2-selection--single, -.select2-container--admin-autocomplete.select2-container--open .select2-selection.select2-selection--single { +.select2-container--admin-autocomplete.select2-container--focus + .select2-selection.select2-selection--single, +.select2-container--admin-autocomplete.select2-container--open + .select2-selection.select2-selection--single { padding: 0; } -.select2-container--admin-autocomplete.select2-container--focus .select2-selection.select2-selection--multiple, -.select2-container--admin-autocomplete.select2-container--open .select2-selection.select2-selection--multiple { +.select2-container--admin-autocomplete.select2-container--focus + .select2-selection.select2-selection--multiple, +.select2-container--admin-autocomplete.select2-container--open + .select2-selection.select2-selection--multiple { padding: 0; } @@ -34,22 +40,30 @@ select.admin-autocomplete { border-radius: 4px; } -.select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered { +.select2-container--admin-autocomplete + .select2-selection--single + .select2-selection__rendered { color: var(--body-fg); line-height: 30px; } -.select2-container--admin-autocomplete .select2-selection--single .select2-selection__clear { +.select2-container--admin-autocomplete + .select2-selection--single + .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; } -.select2-container--admin-autocomplete .select2-selection--single .select2-selection__placeholder { +.select2-container--admin-autocomplete + .select2-selection--single + .select2-selection__placeholder { color: var(--body-quiet-color); } -.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow { +.select2-container--admin-autocomplete + .select2-selection--single + .select2-selection__arrow { height: 26px; position: absolute; top: 1px; @@ -57,7 +71,10 @@ select.admin-autocomplete { width: 20px; } -.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow b { +.select2-container--admin-autocomplete + .select2-selection--single + .select2-selection__arrow + b { border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; @@ -70,25 +87,35 @@ select.admin-autocomplete { width: 0; } -.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--single .select2-selection__clear { +.select2-container--admin-autocomplete[dir="rtl"] + .select2-selection--single + .select2-selection__clear { float: left; } -.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--single .select2-selection__arrow { +.select2-container--admin-autocomplete[dir="rtl"] + .select2-selection--single + .select2-selection__arrow { left: 1px; right: auto; } -.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--single { +.select2-container--admin-autocomplete.select2-container--disabled + .select2-selection--single { background-color: var(--darkened-bg); cursor: default; } -.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--single .select2-selection__clear { +.select2-container--admin-autocomplete.select2-container--disabled + .select2-selection--single + .select2-selection__clear { display: none; } -.select2-container--admin-autocomplete.select2-container--open .select2-selection--single .select2-selection__arrow b { +.select2-container--admin-autocomplete.select2-container--open + .select2-selection--single + .select2-selection__arrow + b { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; } @@ -100,7 +127,9 @@ select.admin-autocomplete { cursor: text; } -.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__rendered { +.select2-container--admin-autocomplete + .select2-selection--multiple + .select2-selection__rendered { box-sizing: border-box; list-style: none; margin: 0; @@ -110,17 +139,24 @@ select.admin-autocomplete { flex-wrap: wrap; } -.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__rendered li { +.select2-container--admin-autocomplete + .select2-selection--multiple + .select2-selection__rendered + li { list-style: none; } -.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__placeholder { +.select2-container--admin-autocomplete + .select2-selection--multiple + .select2-selection__placeholder { color: var(--body-quiet-color); margin-top: 5px; float: left; } -.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__clear { +.select2-container--admin-autocomplete + .select2-selection--multiple + .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; @@ -129,7 +165,9 @@ select.admin-autocomplete { right: 0; } -.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice { +.select2-container--admin-autocomplete + .select2-selection--multiple + .select2-selection__choice { background-color: var(--darkened-bg); border: 1px solid var(--border-color); border-radius: 4px; @@ -140,7 +178,9 @@ select.admin-autocomplete { padding: 0 5px; } -.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice__remove { +.select2-container--admin-autocomplete + .select2-selection--multiple + .select2-selection__choice__remove { color: var(--body-quiet-color); cursor: pointer; display: inline-block; @@ -148,44 +188,67 @@ select.admin-autocomplete { margin-right: 2px; } -.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice__remove:hover { +.select2-container--admin-autocomplete + .select2-selection--multiple + .select2-selection__choice__remove:hover { color: var(--body-fg); } -.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-search--inline { +.select2-container--admin-autocomplete[dir="rtl"] + .select2-selection--multiple + .select2-selection__choice, +.select2-container--admin-autocomplete[dir="rtl"] + .select2-selection--multiple + .select2-selection__placeholder, +.select2-container--admin-autocomplete[dir="rtl"] + .select2-selection--multiple + .select2-search--inline { float: right; } -.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__choice { +.select2-container--admin-autocomplete[dir="rtl"] + .select2-selection--multiple + .select2-selection__choice { margin-left: 5px; margin-right: auto; } -.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { +.select2-container--admin-autocomplete[dir="rtl"] + .select2-selection--multiple + .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; } -.select2-container--admin-autocomplete.select2-container--focus .select2-selection--multiple { +.select2-container--admin-autocomplete.select2-container--focus + .select2-selection--multiple { border: solid var(--body-quiet-color) 1px; outline: 0; } -.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--multiple { +.select2-container--admin-autocomplete.select2-container--disabled + .select2-selection--multiple { background-color: var(--darkened-bg); cursor: default; } -.select2-container--admin-autocomplete.select2-container--disabled .select2-selection__choice__remove { +.select2-container--admin-autocomplete.select2-container--disabled + .select2-selection__choice__remove { display: none; } -.select2-container--admin-autocomplete.select2-container--open.select2-container--above .select2-selection--single, .select2-container--admin-autocomplete.select2-container--open.select2-container--above .select2-selection--multiple { +.select2-container--admin-autocomplete.select2-container--open.select2-container--above + .select2-selection--single, +.select2-container--admin-autocomplete.select2-container--open.select2-container--above + .select2-selection--multiple { border-top-left-radius: 0; border-top-right-radius: 0; } -.select2-container--admin-autocomplete.select2-container--open.select2-container--below .select2-selection--single, .select2-container--admin-autocomplete.select2-container--open.select2-container--below .select2-selection--multiple { +.select2-container--admin-autocomplete.select2-container--open.select2-container--below + .select2-selection--single, +.select2-container--admin-autocomplete.select2-container--open.select2-container--below + .select2-selection--multiple { border-bottom-left-radius: 0; border-bottom-right-radius: 0; } @@ -194,14 +257,18 @@ select.admin-autocomplete { background: var(--darkened-bg); } -.select2-container--admin-autocomplete .select2-search--dropdown .select2-search__field { +.select2-container--admin-autocomplete + .select2-search--dropdown + .select2-search__field { background: var(--body-bg); color: var(--body-fg); border: 1px solid var(--border-color); border-radius: 4px; } -.select2-container--admin-autocomplete .select2-search--inline .select2-search__field { +.select2-container--admin-autocomplete + .select2-search--inline + .select2-search__field { background: transparent; color: var(--body-fg); border: none; @@ -210,60 +277,95 @@ select.admin-autocomplete { -webkit-appearance: textfield; } -.select2-container--admin-autocomplete .select2-results > .select2-results__options { +.select2-container--admin-autocomplete + .select2-results + > .select2-results__options { max-height: 200px; overflow-y: auto; color: var(--body-fg); background: var(--body-bg); } -.select2-container--admin-autocomplete .select2-results__option[role=group] { +.select2-container--admin-autocomplete .select2-results__option[role="group"] { padding: 0; } -.select2-container--admin-autocomplete .select2-results__option[aria-disabled=true] { +.select2-container--admin-autocomplete + .select2-results__option[aria-disabled="true"] { color: var(--body-quiet-color); } -.select2-container--admin-autocomplete .select2-results__option[aria-selected=true] { +.select2-container--admin-autocomplete + .select2-results__option[aria-selected="true"] { background-color: var(--selected-bg); color: var(--body-fg); } -.select2-container--admin-autocomplete .select2-results__option .select2-results__option { +.select2-container--admin-autocomplete + .select2-results__option + .select2-results__option { padding-left: 1em; } -.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__group { +.select2-container--admin-autocomplete + .select2-results__option + .select2-results__option + .select2-results__group { padding-left: 0; } -.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option { +.select2-container--admin-autocomplete + .select2-results__option + .select2-results__option + .select2-results__option { margin-left: -1em; padding-left: 2em; } -.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option .select2-results__option { +.select2-container--admin-autocomplete + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option { margin-left: -2em; padding-left: 3em; } -.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { +.select2-container--admin-autocomplete + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option { margin-left: -3em; padding-left: 4em; } -.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { +.select2-container--admin-autocomplete + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option { margin-left: -4em; padding-left: 5em; } -.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { +.select2-container--admin-autocomplete + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option + .select2-results__option { margin-left: -5em; padding-left: 6em; } -.select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] { +.select2-container--admin-autocomplete + .select2-results__option--highlighted[aria-selected] { background-color: var(--primary); color: var(--primary-fg); } diff --git a/django/contrib/admin/static/admin/css/base.css b/django/contrib/admin/static/admin/css/base.css index 963adafaa049..a89055c19eb5 100644 --- a/django/contrib/admin/static/admin/css/base.css +++ b/django/contrib/admin/static/admin/css/base.css @@ -64,15 +64,8 @@ html[data-theme="light"], --object-tools-hover-bg: var(--close-button-hover-bg); --font-family-primary: - "Segoe UI", - system-ui, - Roboto, - "Helvetica Neue", - Arial, - sans-serif, - "Apple Color Emoji", - "Segoe UI Emoji", - "Segoe UI Symbol", + "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif, + "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-family-monospace: ui-monospace, @@ -96,7 +89,8 @@ html[data-theme="light"], color-scheme: light; } -html, body { +html, +body { height: 100%; } @@ -111,13 +105,17 @@ body { /* LINKS */ -a:link, a:visited { +a:link, +a:visited { color: var(--link-fg); text-decoration: none; - transition: color 0.15s, background 0.15s; + transition: + color 0.15s, + background 0.15s; } -a:focus, a:hover { +a:focus, +a:hover { color: var(--link-hover-color); } @@ -126,12 +124,12 @@ a:focus { } a:not( - [role="button"], - #header a, - #nav-sidebar a, - #content-main.app-list a, - .object-tools a -) { + [role="button"], + #header a, + #nav-sidebar a, + #content-main.app-list a, + .object-tools a + ) { text-decoration: underline; } @@ -139,19 +137,24 @@ a img { border: none; } -a.section:link, a.section:visited { +a.section:link, +a.section:visited { color: var(--header-link-color); text-decoration: none; } -a.section:focus, a.section:hover { +a.section:focus, +a.section:hover { text-decoration: underline; } /* GLOBAL DEFAULTS */ -p, ol, ul, dl { - margin: .2em 0 .8em 0; +p, +ol, +ul, +dl { + margin: 0.2em 0 0.8em 0; } p { @@ -159,7 +162,11 @@ p { line-height: 140%; } -h1,h2,h3,h4,h5 { +h1, +h2, +h3, +h4, +h5 { font-weight: bold; } @@ -171,7 +178,7 @@ h1 { h2 { font-size: 1rem; - margin: 1em 0 .5em 0; + margin: 1em 0 0.5em 0; } h2.subhead { @@ -181,21 +188,21 @@ h2.subhead { h3 { font-size: 0.875rem; - margin: .8em 0 .3em 0; + margin: 0.8em 0 0.3em 0; color: var(--body-medium-color); font-weight: bold; } h4 { font-size: 0.75rem; - margin: 1em 0 .8em 0; + margin: 1em 0 0.8em 0; padding-bottom: 3px; color: var(--body-medium-color); } h5 { font-size: 0.625rem; - margin: 1.5em 0 .5em 0; + margin: 1.5em 0 0.5em 0; color: var(--body-quiet-color); text-transform: uppercase; letter-spacing: 1px; @@ -210,7 +217,9 @@ li ul { margin-bottom: 0; } -li, dt, dd { +li, +dt, +dd { font-size: 0.8125rem; line-height: 1.25rem; } @@ -249,7 +258,8 @@ blockquote { border-left: 5px solid currentColor; } -code, pre { +code, +pre { font-family: var(--font-family-monospace); color: var(--body-quiet-color); font-size: 0.75rem; @@ -287,24 +297,36 @@ hr { font-size: 0.625rem; } -.help, p.help, form p.help, div.help, form div.help, div.help li { +.help, +p.help, +form p.help, +div.help, +form div.help, +div.help li { font-size: 0.6875rem; color: var(--body-quiet-color); } div.help ul { - margin-bottom: 0; + margin-bottom: 0; } .help-tooltip { cursor: help; } -p img, h1 img, h2 img, h3 img, h4 img, td img { +p img, +h1 img, +h2 img, +h3 img, +h4 img, +td img { vertical-align: middle; } -.quiet, a.quiet:link, a.quiet:visited { +.quiet, +a.quiet:link, +a.quiet:visited { color: var(--body-quiet-color); font-weight: normal; } @@ -328,7 +350,8 @@ table { border-color: var(--border-color); } -td, th { +td, +th { font-size: 0.8125rem; line-height: 1rem; border-bottom: 1px solid var(--hairline-color); @@ -365,7 +388,8 @@ tr.alt { background: var(--darkened-bg); } -tr:nth-child(odd), .row-form-errors { +tr:nth-child(odd), +.row-form-errors { background: var(--body-bg); } @@ -385,7 +409,8 @@ thead th { background: var(--darkened-bg); } -thead th a:link, thead th a:visited { +thead th a:link, +thead th a:visited { color: var(--body-quiet-color); } @@ -408,7 +433,8 @@ table thead th .text a { padding: 8px 10px; } -table thead th .text a:focus, table thead th .text a:hover { +table thead th .text a:focus, +table thead th .text a:hover { background: var(--selected-bg); } @@ -428,7 +454,7 @@ table thead th.sorted .sortoptions { } table thead th.sorted .sortpriority { - font-size: .8em; + font-size: 0.8em; min-width: 12px; text-align: center; vertical-align: 3px; @@ -450,7 +476,7 @@ table thead th.sorted .sortoptions a.sortremove { } table thead th.sorted .sortoptions a.sortremove:after { - content: '\\'; + content: "\\"; position: absolute; top: -6px; left: 3px; @@ -490,7 +516,11 @@ table thead th.sorted .sortoptions a.descending:hover { /* FORM DEFAULTS */ -input, textarea, select, .form-row p, form .button { +input, +textarea, +select, +.form-row p, +form .button { margin: 2px 0; padding: 2px 3px; vertical-align: middle; @@ -507,8 +537,15 @@ textarea { Minifiers remove the default (text) "type" attribute from "input" HTML tags. Add input:not([type]) to make the CSS stylesheet work the same. */ -input:not([type]), input[type=text], input[type=password], input[type=email], -input[type=url], input[type=number], input[type=tel], textarea, select, +input:not([type]), +input[type="text"], +input[type="password"], +input[type="email"], +input[type="url"], +input[type="number"], +input[type="tel"], +textarea, +select, .vTextField { border: 1px solid var(--border-color); border-radius: 4px; @@ -522,9 +559,16 @@ input[type=url], input[type=number], input[type=tel], textarea, select, Minifiers remove the default (text) "type" attribute from "input" HTML tags. Add input:not([type]) to make the CSS stylesheet work the same. */ -input:not([type]):focus, input[type=text]:focus, input[type=password]:focus, -input[type=email]:focus, input[type=url]:focus, input[type=number]:focus, -input[type=tel]:focus, textarea:focus, select:focus, .vTextField:focus { +input:not([type]):focus, +input[type="text"]:focus, +input[type="password"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="number"]:focus, +input[type="tel"]:focus, +textarea:focus, +select:focus, +.vTextField:focus { border-color: var(--body-quiet-color); } @@ -540,7 +584,11 @@ select[multiple] { /* FORM BUTTONS */ -.button, input[type=submit], input[type=button], .submit-row input, a.button { +.button, +input[type="submit"], +input[type="button"], +.submit-row input, +a.button { background: var(--button-bg); padding: 10px 15px; border: none; @@ -554,35 +602,47 @@ a.button { padding: 4px 5px; } -.button:active, input[type=submit]:active, input[type=button]:active, -.button:focus, input[type=submit]:focus, input[type=button]:focus, -.button:hover, input[type=submit]:hover, input[type=button]:hover { +.button:active, +input[type="submit"]:active, +input[type="button"]:active, +.button:focus, +input[type="submit"]:focus, +input[type="button"]:focus, +.button:hover, +input[type="submit"]:hover, +input[type="button"]:hover { background: var(--button-hover-bg); } -.button[disabled], input[type=submit][disabled], input[type=button][disabled] { +.button[disabled], +input[type="submit"][disabled], +input[type="button"][disabled] { opacity: 0.4; } -.button.default, input[type=submit].default, .submit-row input.default { +.button.default, +input[type="submit"].default, +.submit-row input.default { border: none; font-weight: 400; background: var(--default-button-bg); } -.button.default:active, input[type=submit].default:active, -.button.default:focus, input[type=submit].default:focus, -.button.default:hover, input[type=submit].default:hover { +.button.default:active, +input[type="submit"].default:active, +.button.default:focus, +input[type="submit"].default:focus, +.button.default:hover, +input[type="submit"].default:hover { background: var(--default-button-hover-bg); } .button[disabled].default, -input[type=submit][disabled].default, -input[type=button][disabled].default { +input[type="submit"][disabled].default, +input[type="button"][disabled].default { opacity: 0.4; } - /* MODULES */ .module { @@ -591,7 +651,12 @@ input[type=button][disabled].default { background: var(--body-bg); } -.module p, .module ul, .module h3, .module h4, .module dl, .module pre { +.module p, +.module ul, +.module h3, +.module h4, +.module dl, +.module pre { padding-left: 10px; padding-right: 10px; } @@ -600,15 +665,18 @@ input[type=button][disabled].default { margin-left: 12px; } -.module ul, .module ol { +.module ul, +.module ol { margin-left: 1.5em; } .module h3 { - margin-top: .6em; + margin-top: 0.6em; } -.module h2, .module caption, .inline-group h2 { +.module h2, +.module caption, +.inline-group h2 { margin: 0; padding: 8px; font-weight: 400; @@ -677,9 +745,9 @@ ul.messagelist li.error { } @media (forced-colors: active) { - ul.messagelist li { - border: 1px solid; - } + ul.messagelist li { + border: 1px solid; + } } .errornote { @@ -727,8 +795,12 @@ td ul.errorlist li { margin: 0; } -.errors input, .errors select, .errors textarea, -td ul.errorlist + input, td ul.errorlist + select, td ul.errorlist + textarea { +.errors input, +.errors select, +.errors textarea, +td ul.errorlist + input, +td ul.errorlist + select, +td ul.errorlist + textarea { border: 1px solid var(--error-fg); } @@ -755,7 +827,7 @@ ol.breadcrumbs li { } ol.breadcrumbs li:not([aria-current="page"])::after { - content: ' \203A ' / ''; + content: " \203A " / ""; } ol.breadcrumbs li a[aria-current="page"] { @@ -768,13 +840,15 @@ ol.breadcrumbs a { color: var(--breadcrumbs-link-fg); } -ol.breadcrumbs a:focus, ol.breadcrumbs a:hover { +ol.breadcrumbs a:focus, +ol.breadcrumbs a:hover { color: var(--breadcrumbs-fg); } /* ACTION ICONS */ -.viewlink, .inlineviewlink { +.viewlink, +.inlineviewlink { padding-left: 16px; background: url(../img/icon-viewlink.svg) 0 center no-repeat; } @@ -789,7 +863,8 @@ ol.breadcrumbs a:focus, ol.breadcrumbs a:hover { background: url(../img/icon-addlink.svg) 0 1px no-repeat; } -.changelink, .inlinechangelink { +.changelink, +.inlinechangelink { padding-left: 16px; background: url(../img/icon-changelink.svg) 0 2px no-repeat; } @@ -799,11 +874,13 @@ ol.breadcrumbs a:focus, ol.breadcrumbs a:hover { background: url(../img/icon-deletelink.svg) 0 1px no-repeat; } -a.deletelink:link, a.deletelink:visited { - color: #CC3434; /* XXX Probably unused? */ +a.deletelink:link, +a.deletelink:visited { + color: #cc3434; /* XXX Probably unused? */ } -a.deletelink:focus, a.deletelink:hover { +a.deletelink:focus, +a.deletelink:hover { color: #993333; /* XXX Probably unused? */ text-decoration: none; } @@ -837,7 +914,8 @@ a.deletelink:focus, a.deletelink:hover { border-radius: 15px; } -.object-tools a:link, .object-tools a:visited { +.object-tools a:link, +.object-tools a:visited { display: block; float: left; padding: 3px 12px; @@ -849,15 +927,17 @@ a.deletelink:focus, a.deletelink:hover { letter-spacing: 0.5px; } -.object-tools a:focus, .object-tools a:hover { +.object-tools a:focus, +.object-tools a:hover { background-color: var(--object-tools-hover-bg); } -.object-tools a:focus{ +.object-tools a:focus { text-decoration: none; } -.object-tools a.viewsitelink, .object-tools a.addlink { +.object-tools a.viewsitelink, +.object-tools a.addlink { background-repeat: no-repeat; background-position: right 7px center; padding-right: 26px; @@ -906,7 +986,7 @@ a.deletelink:focus, a.deletelink:hover { } .main > .content { - flex: 1 0; + flex: 1 0; max-width: 100%; } @@ -945,9 +1025,9 @@ a.deletelink:focus, a.deletelink:hover { } @media (forced-colors: active) { - #content-related { - border: 1px solid; - } + #content-related { + border: 1px solid; + } } /* COLUMN TYPES */ @@ -987,18 +1067,21 @@ a.deletelink:focus, a.deletelink:hover { color: var(--header-color); } -#header a:link, #header a:visited, #logout-form button { +#header a:link, +#header a:visited, +#logout-form button { color: var(--header-link-color); } -#header a:focus , #header a:hover { +#header a:focus, +#header a:hover { text-decoration: underline; } @media (forced-colors: active) { - #header { - border-bottom: 1px solid; - } + #header { + border-bottom: 1px solid; + } } #branding { @@ -1014,7 +1097,8 @@ a.deletelink:focus, a.deletelink:hover { color: var(--header-branding-color); } -#site-name a:link, #site-name a:visited { +#site-name a:link, +#site-name a:visited { color: var(--accent); } @@ -1047,7 +1131,8 @@ a.deletelink:focus, a.deletelink:hover { text-align: right; } -#user-tools, #logout-form button{ +#user-tools, +#logout-form button { padding: 0; font-weight: 300; font-size: 0.6875rem; @@ -1055,17 +1140,21 @@ a.deletelink:focus, a.deletelink:hover { text-transform: uppercase; } -#user-tools a, #logout-form button { +#user-tools a, +#logout-form button { border-bottom: 1px solid rgba(255, 255, 255, 0.25); } -#user-tools a:focus, #user-tools a:hover, -#logout-form button:active, #logout-form button:hover { +#user-tools a:focus, +#user-tools a:hover, +#logout-form button:active, +#logout-form button:hover { text-decoration: none; border-bottom: 0; } -#logout-form button:active, #logout-form button:hover { +#logout-form button:active, +#logout-form button:hover { margin-bottom: 1px; } @@ -1222,7 +1311,7 @@ a.deletelink:focus, a.deletelink:hover { height: 1px; padding: 0; overflow: hidden; - clip: rect(0,0,0,0); + clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; color: var(--body-fg); diff --git a/django/contrib/admin/static/admin/css/changelists.css b/django/contrib/admin/static/admin/css/changelists.css index fc319822c622..38cf7334a5f9 100644 --- a/django/contrib/admin/static/admin/css/changelists.css +++ b/django/contrib/admin/static/admin/css/changelists.css @@ -23,7 +23,9 @@ width: 100%; } -.change-list .hiddenfields { display:none; } +.change-list .hiddenfields { + display: none; +} .change-list .filtered table { border-right: none; @@ -33,7 +35,8 @@ min-height: 400px; } -.change-list .filtered .results, .filtered #toolbar, +.change-list .filtered .results, +.filtered #toolbar, .filtered div.xfull { width: auto; } @@ -168,9 +171,9 @@ } @media (forced-colors: active) { - #changelist-filter { - border: 1px solid; - } + #changelist-filter { + border: 1px solid; + } } #changelist-filter h2 { @@ -202,13 +205,13 @@ } #changelist-filter details > summary::before { - content: '→'; + content: "→"; font-weight: bold; color: var(--link-hover-color); } #changelist-filter details[open] > summary::before { - content: '↓'; + content: "↓"; } #changelist-filter ul { @@ -247,7 +250,8 @@ color: var(--link-selected-fg); } -#changelist-filter a:focus, #changelist-filter a:hover, +#changelist-filter a:focus, +#changelist-filter a:hover, #changelist-filter li.selected a:focus, #changelist-filter li.selected a:hover { color: var(--link-hover-color); @@ -371,6 +375,7 @@ color: var(--body-fg); } -#changelist .actions .button:focus, #changelist .actions .button:hover { +#changelist .actions .button:focus, +#changelist .actions .button:hover { border-color: var(--body-quiet-color); } diff --git a/django/contrib/admin/static/admin/css/dark_mode.css b/django/contrib/admin/static/admin/css/dark_mode.css index 76cbf170a7ad..e19762846059 100644 --- a/django/contrib/admin/static/admin/css/dark_mode.css +++ b/django/contrib/admin/static/admin/css/dark_mode.css @@ -1,48 +1,47 @@ @media (prefers-color-scheme: dark) { :root { - --primary: #264b5d; - --primary-fg: #f7f7f7; - - --body-fg: #eeeeee; - --body-bg: #121212; - --body-quiet-color: #d0d0d0; - --body-medium-color: #e0e0e0; - --body-loud-color: #ffffff; - - --breadcrumbs-link-fg: #e0e0e0; - --breadcrumbs-bg: var(--primary); - - --link-fg: #81d4fa; - --link-hover-color: #4ac1f7; - --link-selected-fg: #6f94c6; - - --hairline-color: #272727; - --border-color: #353535; - - --error-fg: #e35f5f; - - --message-debug-bg: #4e4e4e; - --message-debug-icon: url(../img/icon-debug-dark.svg); - --message-info-bg: #265895; - --message-info-icon: url(../img/icon-info-dark.svg); - --message-success-bg: #006b1b; - --message-success-icon: url(../img/icon-yes-dark.svg); - --message-warning-bg: #583305; - --message-warning-icon: url(../img/icon-alert-dark.svg); - --message-error-bg: #570808; - --message-error-icon: url(../img/icon-no-dark.svg); - - --darkened-bg: #212121; - --selected-bg: #1b1b1b; - --selected-row: #00363a; - - --close-button-bg: #333333; - --close-button-hover-bg: #666666; - - color-scheme: dark; + --primary: #264b5d; + --primary-fg: #f7f7f7; + + --body-fg: #eeeeee; + --body-bg: #121212; + --body-quiet-color: #d0d0d0; + --body-medium-color: #e0e0e0; + --body-loud-color: #ffffff; + + --breadcrumbs-link-fg: #e0e0e0; + --breadcrumbs-bg: var(--primary); + + --link-fg: #81d4fa; + --link-hover-color: #4ac1f7; + --link-selected-fg: #6f94c6; + + --hairline-color: #272727; + --border-color: #353535; + + --error-fg: #e35f5f; + + --message-debug-bg: #4e4e4e; + --message-debug-icon: url(../img/icon-debug-dark.svg); + --message-info-bg: #265895; + --message-info-icon: url(../img/icon-info-dark.svg); + --message-success-bg: #006b1b; + --message-success-icon: url(../img/icon-yes-dark.svg); + --message-warning-bg: #583305; + --message-warning-icon: url(../img/icon-alert-dark.svg); + --message-error-bg: #570808; + --message-error-icon: url(../img/icon-no-dark.svg); + + --darkened-bg: #212121; + --selected-bg: #1b1b1b; + --selected-row: #00363a; + + --close-button-bg: #333333; + --close-button-hover-bg: #666666; + + color-scheme: dark; } - } - +} html[data-theme="dark"] { --primary: #264b5d; diff --git a/django/contrib/admin/static/admin/css/dashboard.css b/django/contrib/admin/static/admin/css/dashboard.css index 242b81a45f85..d303876c796c 100644 --- a/django/contrib/admin/static/admin/css/dashboard.css +++ b/django/contrib/admin/static/admin/css/dashboard.css @@ -1,5 +1,6 @@ /* DASHBOARD */ -.dashboard td, .dashboard th { +.dashboard td, +.dashboard th { word-break: break-word; } @@ -13,7 +14,7 @@ .dashboard .module table td a { display: block; - padding-right: .6em; + padding-right: 0.6em; } /* RECENT ACTIONS MODULE */ diff --git a/django/contrib/admin/static/admin/css/forms.css b/django/contrib/admin/static/admin/css/forms.css index aa2c983be490..e28006cfa401 100644 --- a/django/contrib/admin/static/admin/css/forms.css +++ b/django/contrib/admin/static/admin/css/forms.css @@ -1,4 +1,4 @@ -@import url('widgets.css'); +@import url("widgets.css"); /* FORM ROWS */ @@ -9,7 +9,8 @@ border-bottom: 1px solid var(--hairline-color); } -.form-row img, .form-row input { +.form-row img, +.form-row input { vertical-align: middle; } @@ -45,15 +46,18 @@ form .form-row p { /* FORM LABELS */ -legend, label { +legend, +label { font-weight: normal; color: var(--body-quiet-color); font-size: 0.8125rem; padding: 0; } -.required legend, legend.required, -.required label, label.required { +.required legend, +legend.required, +.required label, +label.required { font-weight: bold; } @@ -116,7 +120,9 @@ fieldset .inline-heading, padding: 0.5rem 0; } -.aligned label + p, .aligned .checkbox-row + div.help, .aligned label + div.readonly { +.aligned label + p, +.aligned .checkbox-row + div.help, +.aligned label + div.readonly { padding: 6px 0; margin-top: 0; margin-bottom: 0; @@ -134,7 +140,8 @@ fieldset .inline-heading, margin-bottom: 0; } -.colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField { +.colMS .aligned .vLargeTextField, +.colMS .aligned .vXMLLargeTextField { width: 350px; } @@ -177,7 +184,8 @@ form .aligned table p { margin-top: -4px; } -.colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField { +.colM .aligned .vLargeTextField, +.colM .aligned .vXMLLargeTextField { width: 610px; } @@ -222,7 +230,8 @@ body.popup .submit-row { line-height: 0.9375rem; } -.submit-row input, .submit-row a { +.submit-row input, +.submit-row a { margin: 0; } @@ -278,7 +287,8 @@ body.popup .submit-row { border: none; } -.vDateField, .vTimeField { +.vDateField, +.vTimeField { margin-right: 2px; margin-bottom: 4px; } @@ -295,7 +305,8 @@ body.popup .submit-row { width: 30em; } -.vLargeTextField, .vXMLLargeTextField { +.vLargeTextField, +.vXMLLargeTextField { width: 48em; } @@ -319,7 +330,8 @@ body.popup .submit-row { width: 5em; } -.vTextField, .vUUIDField { +.vTextField, +.vUUIDField { width: 20em; } diff --git a/django/contrib/admin/static/admin/css/login.css b/django/contrib/admin/static/admin/css/login.css index 805a34b5bdde..31122f9a3457 100644 --- a/django/contrib/admin/static/admin/css/login.css +++ b/django/contrib/admin/static/admin/css/login.css @@ -44,7 +44,8 @@ line-height: 2em; } -.login .form-row #id_username, .login .form-row #id_password { +.login .form-row #id_username, +.login .form-row #id_password { padding: 8px; width: 100%; box-sizing: border-box; diff --git a/django/contrib/admin/static/admin/css/nav_sidebar.css b/django/contrib/admin/static/admin/css/nav_sidebar.css index 7eb0de97ab27..c83a306727cd 100644 --- a/django/contrib/admin/static/admin/css/nav_sidebar.css +++ b/django/contrib/admin/static/admin/css/nav_sidebar.css @@ -52,11 +52,11 @@ } .toggle-nav-sidebar::before { - content: '\00BB'; + content: "\00BB"; } .main.shifted .toggle-nav-sidebar::before { - content: '\00AB'; + content: "\00AB"; } .main > #nav-sidebar { @@ -117,7 +117,8 @@ } @media (max-width: 767px) { - #nav-sidebar, #toggle-nav-sidebar { + #nav-sidebar, + #toggle-nav-sidebar { display: none; } diff --git a/django/contrib/admin/static/admin/css/responsive.css b/django/contrib/admin/static/admin/css/responsive.css index 9524cc526342..4962e2294759 100644 --- a/django/contrib/admin/static/admin/css/responsive.css +++ b/django/contrib/admin/static/admin/css/responsive.css @@ -1,6 +1,7 @@ /* Tablets */ -input[type="submit"], button { +input[type="submit"], +button { -webkit-appearance: none; appearance: none; } @@ -12,7 +13,8 @@ input[type="submit"], button { -webkit-text-size-adjust: 100%; } - td, th { + td, + th { padding: 10px; font-size: 0.875rem; } @@ -86,7 +88,8 @@ input[type="submit"], button { padding-right: 0; } - td .changelink, td .addlink { + td .changelink, + td .addlink { font-size: 0.8125rem; } @@ -114,7 +117,7 @@ input[type="submit"], button { margin: 0 10px 0 6px; } - #toolbar form input[type=submit] { + #toolbar form input[type="submit"] { flex: 0 1 auto; } @@ -159,7 +162,6 @@ input[type="submit"], button { .change-list .filtered .paginator, .filtered #toolbar, .filtered .actions, - #changelist .paginator { border-top-color: var(--hairline-color); /* XXX Is this used at all? */ } @@ -180,12 +182,12 @@ input[type="submit"], button { tags. Add input:not([type]) to make the CSS stylesheet work the same. */ .form-row input:not([type]), - .form-row input[type=text], - .form-row input[type=password], - .form-row input[type=email], - .form-row input[type=url], - .form-row input[type=tel], - .form-row input[type=number], + .form-row input[type="text"], + .form-row input[type="password"], + .form-row input[type="email"], + .form-row input[type="url"], + .form-row input[type="tel"], + .form-row input[type="number"], .form-row textarea, .form-row select, .form-row .vTextField { @@ -233,7 +235,11 @@ input[type="submit"], button { padding: 10px 7px; } - .button, input[type=submit], input[type=button], .submit-row input, a.button { + .button, + input[type="submit"], + input[type="button"], + .submit-row input, + a.button { padding: 7px; } @@ -255,7 +261,8 @@ input[type="submit"], button { flex: 1 1; } - .selector-available, .selector-chosen { + .selector-available, + .selector-chosen { width: auto; flex: 1 1; display: flex; @@ -268,7 +275,8 @@ input[type="submit"], button { margin-bottom: 5px; } - .selector-chooseall, .selector-clearall { + .selector-chooseall, + .selector-clearall { align-self: center; } @@ -285,7 +293,8 @@ input[type="submit"], button { margin-bottom: 0; } - .stacked .selector-available, .stacked .selector-chosen { + .stacked .selector-available, + .stacked .selector-chosen { width: auto; } @@ -298,7 +307,8 @@ input[type="submit"], button { padding: 3px; } - .help-tooltip, .selector .help-icon { + .help-tooltip, + .selector .help-icon { display: none; } @@ -318,10 +328,13 @@ input[type="submit"], button { } .datetimeshortcuts { - color: var(--border-color); /* XXX Redundant, .datetime span also sets #ccc */ + color: var( + --border-color + ); /* XXX Redundant, .datetime span also sets #ccc */ } - .form-row .datetime input.vDateField, .form-row .datetime input.vTimeField { + .form-row .datetime input.vDateField, + .form-row .datetime input.vTimeField { width: 75%; } @@ -374,7 +387,8 @@ input[type="submit"], button { @media (max-width: 767px) { /* Layout */ - #header, #content { + #header, + #content { padding: 15px; } @@ -384,11 +398,13 @@ input[type="submit"], button { /* Dashboard */ - .colMS, .colSM { + .colMS, + .colSM { margin: 0; } - #content-related, .colSM #content-related { + #content-related, + .colSM #content-related { width: 100%; margin: 0; } @@ -540,7 +556,8 @@ input[type="submit"], button { gap: 10px 0; } - .selector-available, .selector-chosen { + .selector-available, + .selector-chosen { flex: 1 1 auto; } @@ -564,15 +581,17 @@ input[type="submit"], button { background-position: 0 0; } - :enabled.selector-remove:focus, :enabled.selector-remove:hover { + :enabled.selector-remove:focus, + :enabled.selector-remove:hover { background-position: 0 -24px; } - .selector-add { + .selector-add { background-position: 0 -48px; } - :enabled.selector-add:focus, :enabled.selector-add:hover { + :enabled.selector-add:focus, + :enabled.selector-add:hover { background-position: 0 -72px; } @@ -593,12 +612,18 @@ input[type="submit"], button { padding: 0 10px; } - .inline-group[data-inline-type="stacked"] .inline-related .module .form-row { + .inline-group[data-inline-type="stacked"] + .inline-related + .module + .form-row { border-top: 1px solid var(--hairline-color); border-bottom: none; } - .inline-group[data-inline-type="stacked"] .inline-related .module .form-row:first-child { + .inline-group[data-inline-type="stacked"] + .inline-related + .module + .form-row:first-child { border-top: none; } @@ -621,7 +646,10 @@ input[type="submit"], button { margin-top: 5px; } - .inline-group[data-inline-type="stacked"] .aligned .form-row > div:not([class]) { + .inline-group[data-inline-type="stacked"] + .aligned + .form-row + > div:not([class]) { width: 100%; } @@ -656,7 +684,9 @@ input[type="submit"], button { gap: 8px; } - .submit-row input, .submit-row input.default, .submit-row a { + .submit-row input, + .submit-row input.default, + .submit-row a { text-align: center; } @@ -678,7 +708,9 @@ input[type="submit"], button { /* Paginator */ - .paginator .this-page, .paginator a:link, .paginator a:visited { + .paginator .this-page, + .paginator a:link, + .paginator a:visited { padding: 4px 10px; } @@ -737,7 +769,8 @@ input[type="submit"], button { /* Calendar and clock */ - .calendarbox, .clockbox { + .calendarbox, + .clockbox { position: fixed !important; top: 50% !important; left: 50% !important; @@ -747,8 +780,9 @@ input[type="submit"], button { overflow: visible; } - .calendarbox:before, .clockbox:before { - content: ''; + .calendarbox:before, + .clockbox:before { + content: ""; position: fixed; top: 50%; left: 50%; @@ -758,7 +792,8 @@ input[type="submit"], button { transform: translate(-50%, -50%); } - .calendarbox > *, .clockbox > * { + .calendarbox > *, + .clockbox > * { position: relative; z-index: 1; } @@ -767,12 +802,14 @@ input[type="submit"], button { z-index: 2; } - .calendarbox .calendar, .clockbox h2 { + .calendarbox .calendar, + .clockbox h2 { border-radius: 4px 4px 0 0; overflow: hidden; } - .calendarbox .calendar-cancel, .clockbox .calendar-cancel { + .calendarbox .calendar-cancel, + .clockbox .calendar-cancel { border-radius: 0 0 4px 4px; overflow: hidden; } @@ -804,14 +841,16 @@ input[type="submit"], button { padding: 10px; } - .calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { + .calendarbox .calendarnav-previous, + .calendarbox .calendarnav-next { z-index: 1; top: 10px; } /* History */ - table#change-history tbody th, table#change-history tbody td { + table#change-history tbody th, + table#change-history tbody td { font-size: 0.8125rem; word-break: break-word; } @@ -822,7 +861,8 @@ input[type="submit"], button { /* Docs */ - table.model tbody th, table.model tbody td { + table.model tbody th, + table.model tbody td { font-size: 0.8125rem; word-break: break-word; } diff --git a/django/contrib/admin/static/admin/css/responsive_rtl.css b/django/contrib/admin/static/admin/css/responsive_rtl.css index 34a3462b6c03..5f6c6305a62d 100644 --- a/django/contrib/admin/static/admin/css/responsive_rtl.css +++ b/django/contrib/admin/static/admin/css/responsive_rtl.css @@ -61,15 +61,17 @@ background-position: 0 0; } - [dir="rtl"] :enabled.selector-remove:focus, :enabled.selector-remove:hover { + [dir="rtl"] :enabled.selector-remove:focus, + :enabled.selector-remove:hover { background-position: 0 -24px; } - [dir="rtl"] .selector-add { + [dir="rtl"] .selector-add { background-position: 0 -48px; } - [dir="rtl"] :enabled.selector-add:focus, :enabled.selector-add:hover { + [dir="rtl"] :enabled.selector-add:focus, + :enabled.selector-add:hover { background-position: 0 -72px; } diff --git a/django/contrib/admin/static/admin/css/rtl.css b/django/contrib/admin/static/admin/css/rtl.css index 9164aa0f4b75..0a4d882a574f 100644 --- a/django/contrib/admin/static/admin/css/rtl.css +++ b/django/contrib/admin/static/admin/css/rtl.css @@ -4,16 +4,21 @@ th { text-align: right; } -.module h2, .module caption { +.module h2, +.module caption { text-align: right; } -.module ul, .module ol { +.module ul, +.module ol { margin-left: 0; margin-right: 1.5em; } -.viewlink, .addlink, .changelink, .hidelink { +.viewlink, +.addlink, +.changelink, +.hidelink { padding-left: 0; padding-right: 16px; background-position-x: 100%; @@ -65,7 +70,7 @@ div.breadcrumbs { /* SORTABLE TABLES */ table thead th.sorted .sortoptions { - float: left; + float: left; } thead th.sorted .text { @@ -76,7 +81,7 @@ thead th.sorted .text { /* dashboard styles */ .dashboard .module table td a { - padding-left: .6em; + padding-left: 0.6em; padding-right: 16px; } @@ -103,7 +108,8 @@ thead th.sorted .text { margin-right: -15px; } -#changelist table tbody td:first-child, #changelist table tbody th:first-child { +#changelist table tbody td:first-child, +#changelist table tbody th:first-child { border-right: none; border-left: none; } @@ -150,7 +156,8 @@ form ul.inline li { background: url(../img/calendar-icons.svg) 0 0 no-repeat; } -.calendar caption, .calendarbox h2 { +.calendar caption, +.calendarbox h2 { text-align: center; } @@ -167,7 +174,8 @@ form ul.inline li { background-size: 24px auto; } -:enabled.selector-add:focus, :enabled.selector-add:hover { +:enabled.selector-add:focus, +:enabled.selector-add:hover { background-position: 0 -120px; } @@ -176,15 +184,18 @@ form ul.inline li { background-size: 24px auto; } -:enabled.selector-remove:focus, :enabled.selector-remove:hover { +:enabled.selector-remove:focus, +:enabled.selector-remove:hover { background-position: 0 -168px; } -:enabled.selector-chooseall:focus, :enabled.selector-chooseall:hover { +:enabled.selector-chooseall:focus, +:enabled.selector-chooseall:hover { background-position: 100% -144px; } -:enabled.selector-clearall:focus, :enabled.selector-clearall:hover { +:enabled.selector-clearall:focus, +:enabled.selector-clearall:hover { background-position: 0 -176px; } @@ -202,8 +213,9 @@ form .form-row p.datetime { /* MISC */ -.inline-related h2, .inline-group h2 { - text-align: right +.inline-related h2, +.inline-group h2 { + text-align: right; } .inline-related h3 span.delete { @@ -211,7 +223,7 @@ form .form-row p.datetime { padding-left: inherit; left: 10px; right: inherit; - float:left; + float: left; } .inline-related h3 span.delete label { diff --git a/django/contrib/admin/static/admin/css/unusable_password_field.css b/django/contrib/admin/static/admin/css/unusable_password_field.css index d46eb0384cfa..d63be331f615 100644 --- a/django/contrib/admin/static/admin/css/unusable_password_field.css +++ b/django/contrib/admin/static/admin/css/unusable_password_field.css @@ -10,10 +10,12 @@ form:has(#id_usable_password input[value="false"]:checked) .field-password2 { } /* Select appropriate submit button */ -form:has(#id_usable_password input[value="true"]:checked) input[type="submit"].unset-password { +form:has(#id_usable_password input[value="true"]:checked) +input[type="submit"].unset-password { display: none; } -form:has(#id_usable_password input[value="false"]:checked) input[type="submit"].set-password { +form:has(#id_usable_password input[value="false"]:checked) + input[type="submit"].set-password { display: none; } diff --git a/django/contrib/admin/static/admin/css/widgets.css b/django/contrib/admin/static/admin/css/widgets.css index c2a3836b90fd..928c81f37612 100644 --- a/django/contrib/admin/static/admin/css/widgets.css +++ b/django/contrib/admin/static/admin/css/widgets.css @@ -13,13 +13,15 @@ width: 100%; } -.selector-available, .selector-chosen { +.selector-available, +.selector-chosen { display: flex; flex-direction: column; flex: 1 1; } -.selector-available-title, .selector-chosen-title { +.selector-available-title, +.selector-chosen-title { border: 1px solid var(--border-color); border-radius: 4px 4px 0 0; } @@ -119,11 +121,14 @@ height: 14em; } -.selector .selector-chosen:not(.selector-chosen--with-filtered) .list-footer-display { +.selector + .selector-chosen:not(.selector-chosen--with-filtered) + .list-footer-display { display: none; } -.selector-add, .selector-remove { +.selector-add, +.selector-remove { width: 24px; height: 24px; display: block; @@ -134,11 +139,13 @@ border: none; } -:enabled.selector-add, :enabled.selector-remove { +:enabled.selector-add, +:enabled.selector-remove { opacity: 1; } -:enabled.selector-add:hover, :enabled.selector-remove:hover { +:enabled.selector-add:hover, +:enabled.selector-remove:hover { cursor: pointer; } @@ -147,7 +154,8 @@ background-size: 24px auto; } -:enabled.selector-add:focus, :enabled.selector-add:hover { +:enabled.selector-add:focus, +:enabled.selector-add:hover { background-position: 0 -168px; } @@ -156,11 +164,13 @@ background-size: 24px auto; } -:enabled.selector-remove:focus, :enabled.selector-remove:hover { +:enabled.selector-remove:focus, +:enabled.selector-remove:hover { background-position: 0 -120px; } -.selector-chooseall, .selector-clearall { +.selector-chooseall, +.selector-clearall { display: inline-block; text-align: left; padding: 4px 5px; @@ -174,24 +184,30 @@ border-radius: 4px; } -:enabled.selector-chooseall:focus, :enabled.selector-clearall:focus, -:enabled.selector-chooseall:hover, :enabled.selector-clearall:hover { +:enabled.selector-chooseall:focus, +:enabled.selector-clearall:focus, +:enabled.selector-chooseall:hover, +:enabled.selector-clearall:hover { background-color: var(--button-hover-bg); } -:enabled.selector-chooseall, :enabled.selector-clearall { +:enabled.selector-chooseall, +:enabled.selector-clearall { opacity: 1; } -:enabled.selector-chooseall:hover, :enabled.selector-clearall:hover { +:enabled.selector-chooseall:hover, +:enabled.selector-clearall:hover { cursor: pointer; } -:enabled.selector-chooseall:focus, :enabled.selector-chooseall:hover { +:enabled.selector-chooseall:focus, +:enabled.selector-chooseall:hover { background-position: 100% -176px; } -:enabled.selector-clearall:focus, :enabled.selector-clearall:hover { +:enabled.selector-clearall:focus, +:enabled.selector-clearall:hover { background-position: 0 -144px; } @@ -208,7 +224,8 @@ height: 10.1em; } -.stacked .selector-available, .stacked .selector-chosen { +.stacked .selector-available, +.stacked .selector-chosen { width: 480px; } @@ -235,7 +252,8 @@ padding: 3px 3px 3px 5px; } -.stacked .selector-chooseall, .stacked .selector-clearall { +.stacked .selector-chooseall, +.stacked .selector-clearall { display: none; } @@ -250,7 +268,8 @@ cursor: pointer; } -.stacked :enabled.selector-add:focus, .stacked :enabled.selector-add:hover { +.stacked :enabled.selector-add:focus, +.stacked :enabled.selector-add:hover { background-position: 0 -72px; cursor: pointer; } @@ -266,7 +285,8 @@ cursor: pointer; } -.stacked :enabled.selector-remove:focus, .stacked :enabled.selector-remove:hover { +.stacked :enabled.selector-remove:focus, +.stacked :enabled.selector-remove:hover { background-position: 0 -24px; cursor: pointer; } @@ -313,7 +333,9 @@ p.datetime label { color: var(--body-quiet-color); } -.datetime input, .form-row .datetime input.vDateField, .form-row .datetime input.vTimeField { +.datetime input, +.form-row .datetime input.vDateField, +.form-row .datetime input.vTimeField { margin-bottom: 4px; } @@ -323,7 +345,8 @@ table p.datetime { padding-left: 0; } -.datetimeshortcuts .clock-icon, .datetimeshortcuts .date-icon { +.datetimeshortcuts .clock-icon, +.datetimeshortcuts .date-icon { position: relative; display: inline-block; vertical-align: middle; @@ -401,7 +424,8 @@ span.clearable-file-input label { /* CALENDARS & CLOCKS */ -.calendarbox, .clockbox { +.calendarbox, +.clockbox { margin: 5px auto; font-size: 0.75rem; width: 19em; @@ -432,7 +456,8 @@ span.clearable-file-input label { width: 100%; } -.calendar caption, .calendarbox h2 { +.calendar caption, +.calendarbox h2 { margin: 0; text-align: center; border-top: none; @@ -474,7 +499,8 @@ span.clearable-file-input label { font-weight: 700; } -.calendar td a, .timelist a { +.calendar td a, +.timelist a { display: block; font-weight: 400; padding: 6px; @@ -482,13 +508,16 @@ span.clearable-file-input label { color: var(--body-quiet-color); } -.calendar td a:focus, .timelist a:focus, -.calendar td a:hover, .timelist a:hover { +.calendar td a:focus, +.timelist a:focus, +.calendar td a:hover, +.timelist a:hover { background: var(--primary); color: white; } -.calendar td a:active, .timelist a:active { +.calendar td a:active, +.timelist a:active { background: var(--header-bg); color: white; } @@ -501,8 +530,10 @@ span.clearable-file-input label { padding: 1px 3px; } -.calendarnav a:link, #calendarnav a:visited, -#calendarnav a:focus, #calendarnav a:hover { +.calendarnav a:link, +#calendarnav a:visited, +#calendarnav a:focus, +#calendarnav a:hover { color: var(--body-quiet-color); } @@ -515,7 +546,8 @@ span.clearable-file-input label { padding: 8px 0; } -.calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { +.calendarbox .calendarnav-previous, +.calendarbox .calendarnav-next { display: block; position: absolute; top: 8px; @@ -544,7 +576,8 @@ span.clearable-file-input label { color: var(--button-fg); } -.calendar-cancel:focus, .calendar-cancel:hover { +.calendar-cancel:focus, +.calendar-cancel:hover { background: var(--close-button-hover-bg); } @@ -553,7 +586,8 @@ span.clearable-file-input label { display: block; } -ul.timelist, .timelist li { +ul.timelist, +.timelist li { list-style-type: none; margin: 0; padding: 0; @@ -573,10 +607,11 @@ ul.timelist, .timelist li { width: 1.5rem; height: 1.5rem; border: 0px none; - margin-bottom: .25rem; + margin-bottom: 0.25rem; } -.inline-deletelink:focus, .inline-deletelink:hover { +.inline-deletelink:focus, +.inline-deletelink:hover { cursor: pointer; } @@ -594,7 +629,7 @@ ul.timelist, .timelist li { } .related-widget-wrapper-link { - opacity: .6; + opacity: 0.6; filter: grayscale(1); } diff --git a/docs/_theme/djangodocs-epub/static/epub.css b/docs/_theme/djangodocs-epub/static/epub.css index 7db68b53fb1a..397d1655a483 100644 --- a/docs/_theme/djangodocs-epub/static/epub.css +++ b/docs/_theme/djangodocs-epub/static/epub.css @@ -1,25 +1,43 @@ -h1 { margin-top: 0; } +h1 { + margin-top: 0; +} /* Keep lists a bit narrow to maximize page estate regarding width. */ -ol, ul { +ol, +ul { margin: 0; padding: 0 0 0 1.3em; } /* Images should never exceed the width of the page. */ -img { max-width: 100%; } +img { + max-width: 100%; +} /* Don't display URL after links, this is not print. */ -.link-target { display: none; } +.link-target { + display: none; +} /* This is the front cover page of the book. */ -.epub-cover { text-align: center; } -.epub-cover h1 { margin: 4em 0 0 0; } -.epub-cover h2 { margin: 1em 0; } -.epub-cover h3 { margin: 3em 0 2em 0; } +.epub-cover { + text-align: center; +} +.epub-cover h1 { + margin: 4em 0 0 0; +} +.epub-cover h2 { + margin: 1em 0; +} +.epub-cover h3 { + margin: 3em 0 2em 0; +} /* Code examples should never exceed the width of the page, so wrap instead. */ -pre, span.pre { white-space: pre-wrap; } +pre, +span.pre { + white-space: pre-wrap; +} pre { background-color: #f6f6f6; @@ -40,12 +58,18 @@ pre { margin-top: 0; } -a:link, a:visited { color: #396623; } -a:hover { color: #1d3311; } +a:link, +a:visited { + color: #396623; +} +a:hover { + color: #1d3311; +} /* Use special styled note boxes from the default theme, but with the left side fitted after the icon, to allow text resizing with breaking. */ -.note, .admonition { +.note, +.admonition { background-position: 9px 0.8em; background-repeat: no-repeat; padding: 0.8em 1em 0.8em 65px; @@ -53,14 +77,25 @@ fitted after the icon, to allow text resizing with breaking. */ border: 0.01em solid black; } -.note, .admonition { background-image: url(docicons-note.png); } -div.admonition-philosophy { background-image: url(docicons-philosophy.png); } -div.admonition-behind-the-scenes { background-image: url(docicons-behindscenes.png); } -.admonition.warning { background-image: url(docicons-warning.png); } +.note, +.admonition { + background-image: url(docicons-note.png); +} +div.admonition-philosophy { + background-image: url(docicons-philosophy.png); +} +div.admonition-behind-the-scenes { + background-image: url(docicons-behindscenes.png); +} +.admonition.warning { + background-image: url(docicons-warning.png); +} .admonition-title { font-weight: bold; margin: 0; } -.admonition .last { margin-bottom: 0; } +.admonition .last { + margin-bottom: 0; +} diff --git a/docs/_theme/djangodocs/static/console-tabs.css b/docs/_theme/djangodocs/static/console-tabs.css index c13ec7b1ac48..93d4fa7ff82a 100644 --- a/docs/_theme/djangodocs/static/console-tabs.css +++ b/docs/_theme/djangodocs/static/console-tabs.css @@ -1,46 +1,46 @@ @import url("{{ pathto('_static/fontawesome/css/fa-brands.min.css', 1) }}"); .console-block { - text-align: right; + text-align: right; } .console-block *:before, .console-block *:after { - box-sizing: border-box; + box-sizing: border-box; } .console-block > section { - display: none; - text-align: left; + display: none; + text-align: left; } .console-block > input.c-tab-unix, .console-block > input.c-tab-win { - display: none; + display: none; } .console-block > label { - display: inline-block; - padding: 4px 8px; - font-weight: normal; - text-align: center; - color: #bbb; - border: 1px solid transparent; - font-family: fontawesome; + display: inline-block; + padding: 4px 8px; + font-weight: normal; + text-align: center; + color: #bbb; + border: 1px solid transparent; + font-family: fontawesome, sans-serif; } .console-block > input:checked + label { - color: #555; - border: 1px solid #ddd; - border-top: 2px solid #ab5603; - border-bottom: 1px solid #fff; + color: #555; + border: 1px solid #ddd; + border-top: 2px solid #ab5603; + border-bottom: 1px solid #fff; } .console-block > .c-tab-unix:checked ~ .c-content-unix, -.console-block > .c-tab-win:checked ~ .c-content-win { - display: block; +.console-block > .c-tab-win:checked ~ .c-content-win { + display: block; } .console-block pre { - margin-top: 0px; + margin-top: 0px; } diff --git a/docs/_theme/djangodocs/static/djangodocs.css b/docs/_theme/djangodocs/static/djangodocs.css index 0b6a8b9ad3bc..cbe02c3e7c64 100644 --- a/docs/_theme/djangodocs/static/djangodocs.css +++ b/docs/_theme/djangodocs/static/djangodocs.css @@ -1,145 +1,530 @@ /*** setup ***/ -html { background:#092e20;} -body { font:12px/1.5 Verdana,sans-serif; background:#092e20; color: white;} -#custom-doc { width:76.54em;*width:74.69em;min-width:995px; max-width:100em; margin:auto; text-align:left; padding-top:16px; margin-top:0;} -#hd { padding: 4px 0 12px 0; } -#bd { background:#234F32; } -#ft { color:#487858; font-size:90%; padding-bottom: 2em; } +html { + background: #092e20; +} +body { + font: + 12px / 1.5 Verdana, + sans-serif; + background: #092e20; + color: white; +} +#custom-doc { + width: 76.54em; + min-width: 995px; + max-width: 100em; + margin: auto; + text-align: left; + padding-top: 16px; + margin-top: 0; +} +#hd { + padding: 4px 0 12px 0; +} +#bd { + background: #234f32; +} +#ft { + color: #487858; + font-size: 90%; + padding-bottom: 2em; +} /*** links ***/ -a {text-decoration: none;} -a img {border: none;} -a:link, a:visited { color:#ffc757; } -#bd a:link, #bd a:visited { color:#ab5603; text-decoration:underline; } -#bd #sidebar a:link, #bd #sidebar a:visited { color:#ffc757; text-decoration:none; } -a:hover { color:#ffe761; } -#bd a:hover { background-color:#E0FFB8; color:#234f32; text-decoration:none; } -#bd #sidebar a:hover { color:#ffe761; background:none; } -h2 a, h3 a, h4 a { text-decoration:none !important; } -a.reference em { font-style: normal; } +a { + text-decoration: none; +} +a img { + border: none; +} +a:link, +a:visited { + color: #ffc757; +} +#bd a:link, +#bd a:visited { + color: #ab5603; + text-decoration: underline; +} +#bd #sidebar a:link, +#bd #sidebar a:visited { + color: #ffc757; + text-decoration: none; +} +a:hover { + color: #ffe761; +} +#bd a:hover { + background-color: #e0ffb8; + color: #234f32; + text-decoration: none; +} +#bd #sidebar a:hover { + color: #ffe761; + background: none; +} +h2 a, +h3 a, +h4 a { + text-decoration: none !important; +} +a.reference em { + font-style: normal; +} /*** sidebar ***/ -#sidebar div.sphinxsidebarwrapper { font-size:92%; margin-right: 14px; } -#sidebar h3, #sidebar h4 { color: white; font-size: 125%; } -#sidebar a { color: white; } -#sidebar ul ul { margin-top:0; margin-bottom:0; } -#sidebar li { margin-top: 0.2em; margin-bottom: 0.2em; } +#sidebar div.sphinxsidebarwrapper { + font-size: 92%; + margin-right: 14px; +} +#sidebar h3, +#sidebar h4 { + color: white; + font-size: 125%; +} +#sidebar a { + color: white; +} +#sidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} +#sidebar li { + margin-top: 0.2em; + margin-bottom: 0.2em; +} /*** nav ***/ -div.nav { margin: 0; font-size: 11px; text-align: right; color: #487858;} -#hd div.nav { margin-top: -27px; } -#ft div.nav { margin-bottom: -18px; } -#hd h1 a { color: white; } -#global-nav { position:absolute; top:5px; margin-left: -5px; padding:7px 0; color:#263E2B; } -#global-nav a:link, #global-nav a:visited {color:#487858;} -#global-nav a {padding:0 4px;} -#global-nav a.about {padding-left:0;} -#global-nav:hover {color:#fff;} -#global-nav:hover a:link, #global-nav:hover a:visited { color:#ffc757; } +div.nav { + margin: 0; + font-size: 11px; + text-align: right; + color: #487858; +} +#hd div.nav { + margin-top: -27px; +} +#ft div.nav { + margin-bottom: -18px; +} +#hd h1 a { + color: white; +} +#global-nav { + position: absolute; + top: 5px; + margin-left: -5px; + padding: 7px 0; + color: #263e2b; +} +#global-nav a:link, +#global-nav a:visited { + color: #487858; +} +#global-nav a { + padding: 0 4px; +} +#global-nav a.about { + padding-left: 0; +} +#global-nav:hover { + color: #fff; +} +#global-nav:hover a:link, +#global-nav:hover a:visited { + color: #ffc757; +} /*** content ***/ -#yui-main div.yui-b { position: relative; } -#yui-main div.yui-b { margin: 0 0 0 20px; background: white; color: black; padding: 0.3em 2em 1em 2em; } +#yui-main div.yui-b { + position: relative; +} +#yui-main div.yui-b { + margin: 0 0 0 20px; + background: white; + color: black; + padding: 0.3em 2em 1em 2em; +} /*** basic styles ***/ -dd { margin-left:15px; } -h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12 { margin-top:1em; font-family:"Trebuchet MS",sans-serif; font-weight:normal; } -h1 { font-size:218%; margin-top:0.6em; margin-bottom:.4em; line-height:1.1em; } -h2 { font-size:175%; margin-bottom:.6em; line-height:1.2em; color:#092e20; } -h3 { font-size:150%; font-weight:bold; margin-bottom:.2em; color:#487858; } -h4 { font-size:125%; font-weight:bold; margin-top:1.5em; margin-bottom:3px; } -h5 { font-size:110%; font-weight:bold; margin-top:1em; margin-bottom:3px; } -h6,h7,h8,h9,h10,h11,h12 { font-weight:bold; margin-bottom:3px; } -div.figure { text-align: center; } -div.figure p.caption { font-size:1em; margin-top:0; margin-bottom:1.5em; color: #555;} -hr { color:#ccc; background-color:#ccc; height:1px; border:0; } -p, ul, dl { margin-top:.6em; margin-bottom:1em; padding-bottom: 0.1em;} -#yui-main div.yui-b img { max-width: 50em; margin-left: auto; margin-right: auto; display: block; } -caption { font-size:1em; font-weight:bold; margin-top:0.5em; margin-bottom:0.5em; margin-left: 2px; text-align: center; } -blockquote { padding: 0 1em; margin: 1em 0; font:125%/1.2em "Trebuchet MS", sans-serif; color:#234f32; border-left:2px solid #94da3a; } -strong { font-weight: bold; } -em { font-style: italic; } -ins { font-weight: bold; text-decoration: none; } +dd { + margin-left: 15px; +} +h1, +h2, +h3, +h4, +h5, +h6 { + margin-top: 1em; + font-family: "Trebuchet MS", sans-serif; + font-weight: normal; +} +h1 { + font-size: 218%; + margin-top: 0.6em; + margin-bottom: 0.4em; + line-height: 1.1em; +} +h2 { + font-size: 175%; + margin-bottom: 0.6em; + line-height: 1.2em; + color: #092e20; +} +h3 { + font-size: 150%; + font-weight: bold; + margin-bottom: 0.2em; + color: #487858; +} +h4 { + font-size: 125%; + font-weight: bold; + margin-top: 1.5em; + margin-bottom: 3px; +} +h5 { + font-size: 110%; + font-weight: bold; + margin-top: 1em; + margin-bottom: 3px; +} +h6 { + font-weight: bold; + margin-bottom: 3px; +} +div.figure { + text-align: center; +} +div.figure p.caption { + font-size: 1em; + margin-top: 0; + margin-bottom: 1.5em; + color: #555; +} +hr { + color: #ccc; + background-color: #ccc; + height: 1px; + border: 0; +} +p, +ul, +dl { + margin-top: 0.6em; + margin-bottom: 1em; + padding-bottom: 0.1em; +} +#yui-main div.yui-b img { + max-width: 50em; + margin-left: auto; + margin-right: auto; + display: block; +} +caption { + font-size: 1em; + font-weight: bold; + margin-top: 0.5em; + margin-bottom: 0.5em; + margin-left: 2px; + text-align: center; +} +blockquote { + padding: 0 1em; + margin: 1em 0; + font: + 125% / 1.2em "Trebuchet MS", + sans-serif; + color: #234f32; + border-left: 2px solid #94da3a; +} +strong { + font-weight: bold; +} +em { + font-style: italic; +} +ins { + font-weight: bold; + text-decoration: none; +} /*** lists ***/ -ul { padding-left:30px; } -ol { padding-left:30px; } -ol.arabic li { list-style-type: decimal; } -ul li { list-style-type:square; margin-bottom:.4em; } -ul ul li { list-style-type:disc; } -ul ul ul li { list-style-type:circle; } -ol li { margin-bottom: .4em; } -ul ul { padding-left:1.2em; } -ul ul ul { padding-left:1em; } -ul.linklist, ul.toc { padding-left:0; } -ul.toc ul { margin-left:.6em; } -ul.toc ul li { list-style-type:square; } -ul.toc ul ul li { list-style-type:disc; } -ul.linklist li, ul.toc li { list-style-type:none; } -dt { font-weight:bold; margin-top:.5em; font-size:1.1em; } -dd { margin-bottom:.8em; } -ol.toc { margin-bottom: 2em; } -ol.toc li { font-size:125%; padding: .5em; line-height:1.2em; clear: right; } -ol.toc li.b { background-color: #E0FFB8; } -ol.toc li a:hover { background-color: transparent !important; text-decoration: underline !important; } -ol.toc span.release-date { color:#487858; float: right; font-size: 85%; padding-right: .5em; } -ol.toc span.comment-count { font-size: 75%; color: #999; } +ul { + padding-left: 30px; +} +ol { + padding-left: 30px; +} +ol.arabic li { + list-style-type: decimal; +} +ul li { + list-style-type: square; + margin-bottom: 0.4em; +} +ul ul li { + list-style-type: disc; +} +ul ul ul li { + list-style-type: circle; +} +ol li { + margin-bottom: 0.4em; +} +ul ul { + padding-left: 1.2em; +} +ul ul ul { + padding-left: 1em; +} +ul.linklist, +ul.toc { + padding-left: 0; +} +ul.toc ul { + margin-left: 0.6em; +} +ul.toc ul li { + list-style-type: square; +} +ul.toc ul ul li { + list-style-type: disc; +} +ul.linklist li, +ul.toc li { + list-style-type: none; +} +dt { + font-weight: bold; + margin-top: 0.5em; + font-size: 1.1em; +} +dd { + margin-bottom: 0.8em; +} +ol.toc { + margin-bottom: 2em; +} +ol.toc li { + font-size: 125%; + padding: 0.5em; + line-height: 1.2em; + clear: right; +} +ol.toc li.b { + background-color: #e0ffb8; +} +ol.toc li a:hover { + background-color: transparent !important; + text-decoration: underline !important; +} +ol.toc span.release-date { + color: #487858; + float: right; + font-size: 85%; + padding-right: 0.5em; +} +ol.toc span.comment-count { + font-size: 75%; + color: #999; +} /*** tables ***/ -table { color:#000; margin-bottom: 1em; width: 100%; } -table.docutils td p { margin-top:0; margin-bottom:.5em; } -table.docutils td, table.docutils th { border-bottom:1px solid #dfdfdf; padding:4px 2px;} -table.docutils thead th { border-bottom:2px solid #dfdfdf; text-align:left; font-weight: bold; white-space: nowrap; } -table.docutils thead th p { margin: 0; padding: 0; } -table.docutils { border-collapse:collapse; } +table { + color: #000; + margin-bottom: 1em; + width: 100%; +} +table.docutils td p { + margin-top: 0; + margin-bottom: 0.5em; +} +table.docutils td, +table.docutils th { + border-bottom: 1px solid #dfdfdf; + padding: 4px 2px; +} +table.docutils thead th { + border-bottom: 2px solid #dfdfdf; + text-align: left; + font-weight: bold; + white-space: nowrap; +} +table.docutils thead th p { + margin: 0; + padding: 0; +} +table.docutils { + border-collapse: collapse; +} /*** code blocks ***/ -.literal { color:#234f32; white-space:nowrap; } -dt > tt.literal { white-space: normal; } -#sidebar .literal { color:white; background:transparent; font-size:11px; } -h4 .literal { color: #234f32; font-size: 13px; } -pre { font-size:small; background:#E0FFB8; border:1px solid #94da3a; border-width:1px 0; margin: 1em 0; padding: .3em .4em; overflow: hidden; line-height: 1.3em; white-space: pre-wrap;} -dt .literal, table .literal { background:none; } -#bd a.reference { text-decoration: none; } -#bd a.reference tt.literal { border-bottom: 1px #234f32 dotted; } -div.code-block-caption { color: white; background-color: #234F32; margin: 0; padding: 2px 5px; width: 100%; font-family: monospace; font-size: small; line-height: 1.3em; } -div.code-block-caption .literal {color: white; } -div.literal-block-wrapper pre { margin-top: 0; } +.literal { + color: #234f32; + white-space: nowrap; +} +dt > tt.literal { + white-space: normal; +} +#sidebar .literal { + color: white; + background: transparent; + font-size: 11px; +} +h4 .literal { + color: #234f32; + font-size: 13px; +} +pre { + font-size: small; + background: #e0ffb8; + border: 1px solid #94da3a; + border-width: 1px 0; + margin: 1em 0; + padding: 0.3em 0.4em; + overflow: hidden; + line-height: 1.3em; + white-space: pre-wrap; +} +dt .literal, +table .literal { + background: none; +} +#bd a.reference { + text-decoration: none; +} +#bd a.reference tt.literal { + border-bottom: 1px #234f32 dotted; +} +div.code-block-caption { + color: white; + background-color: #234f32; + margin: 0; + padding: 2px 5px; + width: 100%; + font-family: monospace; + font-size: small; + line-height: 1.3em; +} +div.code-block-caption .literal { + color: white; +} +div.literal-block-wrapper pre { + margin-top: 0; +} /* Restore colors of pygments hyperlinked code */ -#bd .highlight .k a:link, #bd .highlight .k a:visited { color: #000000; text-decoration: none; border-bottom: 1px dotted #000000; } -#bd .highlight .nf a:link, #bd .highlight .nf a:visited { color: #990000; text-decoration: none; border-bottom: 1px dotted #990000; } - +#bd .highlight .k a:link, +#bd .highlight .k a:visited { + color: #000000; + text-decoration: none; + border-bottom: 1px dotted #000000; +} +#bd .highlight .nf a:link, +#bd .highlight .nf a:visited { + color: #990000; + text-decoration: none; + border-bottom: 1px dotted #990000; +} /*** notes & admonitions ***/ -.note, .admonition { padding:.8em 1em .8em; margin: 1em 0; border:1px solid #94da3a; } -.admonition-title { font-weight:bold; margin-top:0 !important; margin-bottom:0 !important;} -.admonition .last { margin-bottom:0 !important; } -.note, .admonition { padding-left:65px; background:url(docicons-note.png) .8em .8em no-repeat;} -div.admonition-philosophy { padding-left:65px; background:url(docicons-philosophy.png) .8em .8em no-repeat;} -div.admonition-behind-the-scenes { padding-left:65px; background:url(docicons-behindscenes.png) .8em .8em no-repeat;} -.admonition.warning { background:url(docicons-warning.png) .8em .8em no-repeat; border:1px solid #ffc83c;} +.note, +.admonition { + padding: 0.8em 1em 0.8em; + margin: 1em 0; + border: 1px solid #94da3a; +} +.admonition-title { + font-weight: bold; + margin-top: 0 !important; + margin-bottom: 0 !important; +} +.admonition .last { + margin-bottom: 0 !important; +} +.note, +.admonition { + padding-left: 65px; + background: url(docicons-note.png) 0.8em 0.8em no-repeat; +} +div.admonition-philosophy { + padding-left: 65px; + background: url(docicons-philosophy.png) 0.8em 0.8em no-repeat; +} +div.admonition-behind-the-scenes { + padding-left: 65px; + background: url(docicons-behindscenes.png) 0.8em 0.8em no-repeat; +} +.admonition.warning { + background: url(docicons-warning.png) 0.8em 0.8em no-repeat; + border: 1px solid #ffc83c; +} /*** versionadded/changes ***/ -div.versionadded, div.versionchanged { } -div.versionadded span.title, div.versionchanged span.title, span.versionmodified { font-weight: bold; } -div.versionadded, div.versionchanged, div.deprecated { color:#555; } +div.versionadded span.title, +div.versionchanged span.title, +span.versionmodified { + font-weight: bold; +} +div.versionadded, +div.versionchanged, +div.deprecated { + color: #555; +} /*** p-links ***/ -a.headerlink { color: #c60f0f; font-size: 0.8em; margin-left: 4px; opacity: 0; text-decoration: none; } -h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, h4:hover > a.headerlink, h5:hover > a.headerlink, h6:hover > a.headerlink, dt:hover > a.headerlink { opacity: 1; } -a.headerlink:focus { opacity: 1; } +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + margin-left: 4px; + opacity: 0; + text-decoration: none; +} +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink { + opacity: 1; +} +a.headerlink:focus { + opacity: 1; +} /*** index ***/ -table.indextable td { text-align: left; vertical-align: top;} -table.indextable dl, table.indextable dd { margin-top: 0; margin-bottom: 0; } -table.indextable tr.pcap { height: 10px; } -table.indextable tr.cap { margin-top: 10px; background-color: #f2f2f2;} +table.indextable td { + text-align: left; + vertical-align: top; +} +table.indextable dl, +table.indextable dd { + margin-top: 0; + margin-bottom: 0; +} +table.indextable tr.pcap { + height: 10px; +} +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} /*** page-specific overrides ***/ -div#contents ul { margin-bottom: 0;} -div#contents ul li { margin-bottom: 0;} -div#contents ul ul li { margin-top: 0.3em;} +div#contents ul { + margin-bottom: 0; +} +div#contents ul li { + margin-bottom: 0; +} +div#contents ul ul li { + margin-top: 0.3em; +} /*** IE hacks ***/ -* pre { width: 100%; } +* pre { + width: 100%; +} diff --git a/docs/_theme/djangodocs/static/homepage.css b/docs/_theme/djangodocs/static/homepage.css index 3f69f01b2e76..1e393ba43da7 100644 --- a/docs/_theme/djangodocs/static/homepage.css +++ b/docs/_theme/djangodocs/static/homepage.css @@ -1,22 +1,48 @@ -#index p.rubric { font-size:150%; font-weight:normal; margin-bottom:.2em; color:#487858; } +#index p.rubric { + font-size: 150%; + font-weight: normal; + margin-bottom: 0.2em; + color: #487858; +} -#index div.section dt { font-weight: normal; } +#index div.section dt { + font-weight: normal; +} -#index #s-getting-help { float: right; width: 35em; background: #E1ECE2; padding: 1em; margin: 2em 0 2em 2em; } -#index #s-getting-help h2 { margin: 0; } +#index #s-getting-help { + float: right; + width: 35em; + background: #e1ece2; + padding: 1em; + margin: 2em 0 2em 2em; +} +#index #s-getting-help h2 { + margin: 0; +} -#index #s-django-documentation div.section div.section h3 { margin: 0; } -#index #s-django-documentation div.section div.section { background: #E1ECE2; padding: 1em; margin: 2em 0 2em 40.3em; } -#index #s-django-documentation div.section div.section a.reference { white-space: nowrap; } +#index #s-django-documentation div.section div.section h3 { + margin: 0; +} +#index #s-django-documentation div.section div.section { + background: #e1ece2; + padding: 1em; + margin: 2em 0 2em 40.3em; +} +#index #s-django-documentation div.section div.section a.reference { + white-space: nowrap; +} #index #s-using-django dl, #index #s-add-on-contrib-applications dl, #index #s-solving-specific-problems dl, -#index #s-reference dl - { float: left; width: 41em; } +#index #s-reference dl { + float: left; + width: 41em; +} #index #s-add-on-contrib-applications, #index #s-solving-specific-problems, #index #s-reference, -#index #s-and-all-the-rest - { clear: left; } +#index #s-and-all-the-rest { + clear: left; +} From 820c7d3248af6afbdf3390c97b29e41ba126a421 Mon Sep 17 00:00:00 2001 From: garybadwal Date: Thu, 16 Apr 2026 11:46:13 +0530 Subject: [PATCH 3/4] Fixed #37036 -- Added missing flat=True arg in DeferredAttribute.fetch_many(). --- AUTHORS | 1 + django/db/models/query_utils.py | 2 +- tests/defer/tests.py | 14 ++++++++++++++ tests/many_to_one/tests.py | 13 +++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 486a50f0e285..07c87068a9d3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -422,6 +422,7 @@ answer newbie questions, and generally made Django that much better: Grzegorz Ślusarek Guilherme Mesquita Gondim Guillaume Pannatier + Gurpreet Singh Gustavo Picon hambaloney Hang Park diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py index a17274fba0dc..c282c4f7446d 100644 --- a/django/db/models/query_utils.py +++ b/django/db/models/query_utils.py @@ -296,7 +296,7 @@ def fetch_many(self, instances): db = instances[0]._state.db value_by_pk = ( self.field.model._base_manager.using(db) - .values_list(attname) + .values_list(attname, flat=True) .in_bulk({i.pk for i in instances}) ) for instance in instances: diff --git a/tests/defer/tests.py b/tests/defer/tests.py index 1a5f333fa18a..ea7703c1e369 100644 --- a/tests/defer/tests.py +++ b/tests/defer/tests.py @@ -219,6 +219,20 @@ def test_defer_fetch_mode_fetch_peers_single(self): with self.assertNumQueries(1): p1.value + def test_defer_fk_fetch_mode_fetch_peers(self): + p1, p2 = Primary.objects.fetch_mode(FETCH_PEERS).defer("related") + with self.assertNumQueries(2): + self.assertEqual(p1.related, self.s1) + with self.assertNumQueries(0): + self.assertEqual(p2.related, self.s1) + + def test_only_fk_fetch_mode_fetch_peers(self): + p1, p2 = Primary.objects.fetch_mode(FETCH_PEERS).only("name") + with self.assertNumQueries(2): + self.assertEqual(p1.related, self.s1) + with self.assertNumQueries(0): + self.assertEqual(p2.related, self.s1) + def test_only_fetch_mode_raise(self): p1 = Primary.objects.fetch_mode(RAISE).only("name").get(name="p1") msg = "Fetching of Primary.value blocked." diff --git a/tests/many_to_one/tests.py b/tests/many_to_one/tests.py index e161686906b7..d6149d521f2a 100644 --- a/tests/many_to_one/tests.py +++ b/tests/many_to_one/tests.py @@ -1002,3 +1002,16 @@ def test_fetch_mode_copied_reverse_fetching_many(self): a2._state.fetch_mode, FETCH_PEERS, ) + + def test_fetch_mode_fetch_peers_reverse_with_deferred_fk(self): + Article.objects.create( + headline="Another article", + pub_date=datetime.date(2005, 7, 27), + reporter=self.r, + ) + r = Reporter.objects.fetch_mode(FETCH_PEERS).get(pk=self.r.pk) + a1, a2 = r.article_set.defer("reporter") + with self.assertNumQueries(2): + self.assertEqual(a1.reporter, self.r) + with self.assertNumQueries(0): + self.assertEqual(a2.reporter, self.r) From 1b0d46f715849de53563aaf6912b4ded7d61641d Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sat, 18 Apr 2026 15:49:29 +0300 Subject: [PATCH 4/4] Refs #35007 -- Ignored CSS formatting changes in git blame. --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 05d11bcbb7f8..7dfff8bf47e2 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -17,3 +17,4 @@ c9178ef17a0e1070f5a25096d8e13385d404dc92 1101467ce0756272a54f4c7bc65c4c335a94111b 6cff02078799b7c683a0d39630d49ab4fe532e7c 4286a23df64f6ce3b9b6ed097f4d1aac7d9e0de4 +241b8e1aab7fc71018a059467b2ba17bce6556cc