0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-21 18:09:02 +01:00

Refactor float usage within admin styles. Fix #8126

This commit is contained in:
Thibaud Colas 2023-12-18 17:03:03 +00:00 committed by sag​e
parent 9b409b5a3e
commit 6cc4533a6f
16 changed files with 37 additions and 43 deletions

View File

@ -22,12 +22,6 @@ module.exports = {
], ],
// Would be valuable for strict BEM components but is too hard to enforce with legacy code. // Would be valuable for strict BEM components but is too hard to enforce with legacy code.
'no-descending-specificity': null, 'no-descending-specificity': null,
// Override stylelint-config-wagtails options to allow all float and clear values for now.
'declaration-property-value-allowed-list': {
// 'clear': ['both', 'none'],
// 'float': ['inline-start', 'inline-end', 'none', 'unset'],
'text-align': ['start', 'end', 'center'],
},
// Refined ordering to align with media mixin usage - see https://github.com/wagtail/stylelint-config-wagtail/issues/37 // Refined ordering to align with media mixin usage - see https://github.com/wagtail/stylelint-config-wagtail/issues/37
'order/order': [ 'order/order': [
'dollar-variables', 'dollar-variables',

View File

@ -13,7 +13,7 @@
height: 3em; height: 3em;
line-height: 3em; line-height: 3em;
text-align: start; text-align: start;
float: left; float: inline-start;
} }
.action-secondary { .action-secondary {

View File

@ -13,7 +13,7 @@
} }
li { li {
float: left; float: inline-start;
.dropdown li, // dropdown li .dropdown li, // dropdown li
&:last-child { &:last-child {
@ -84,7 +84,7 @@
} }
.meta { .meta {
float: right; float: inline-end;
text-align: end; text-align: end;
padding: 7px math.div($grid-gutter-width, 2); padding: 7px math.div($grid-gutter-width, 2);
font-size: 0.85em; font-size: 0.85em;

View File

@ -32,7 +32,7 @@
scroll-behavior: smooth; scroll-behavior: smooth;
width: 100%; width: 100%;
height: 100%; // this has no effect on desktop, but on mobile it helps aesthetics of menu popout action height: 100%; // this has no effect on desktop, but on mobile it helps aesthetics of menu popout action
float: left; float: inline-start;
position: relative; position: relative;
border-bottom: 1px solid theme('colors.border-furniture'); border-bottom: 1px solid theme('colors.border-furniture');
} }

View File

@ -57,12 +57,12 @@
} }
.col { .col {
float: left; float: inline-start;
margin-inline-end: 2em; margin-inline-end: 2em;
} }
.left { .left {
float: left; float: inline-start;
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
@ -72,7 +72,7 @@
display: flex; display: flex;
gap: theme('spacing[2.5]'); gap: theme('spacing[2.5]');
text-align: end; text-align: end;
float: right; float: inline-end;
} }
// For case where content below header should merge with it // For case where content below header should merge with it
@ -132,12 +132,12 @@
} }
.left { .left {
float: left; float: inline-start;
margin-inline-end: 0; margin-inline-end: 0;
&:first-child { &:first-child {
padding-bottom: 0; padding-bottom: 0;
float: left; float: inline-start;
} }
} }
@ -146,7 +146,7 @@
.right, .right,
.left { .left {
float: right; float: inline-end;
} }
} }

View File

@ -231,7 +231,7 @@ ul.listing {
} }
.actions { .actions {
float: right; float: inline-end;
font-size: 0.8rem; font-size: 0.8rem;
margin: 0; margin: 0;
@ -240,7 +240,7 @@ ul.listing {
} }
> li { > li {
float: left; float: inline-start;
padding: 0 0.5em 0 0; padding: 0 0.5em 0 0;
vertical-align: middle; vertical-align: middle;
} }
@ -277,7 +277,7 @@ ul.listing {
} }
.moderate-actions form { .moderate-actions form {
float: left; float: inline-start;
margin: 0 1em 1em 0; margin: 0 1em 1em 0;
} }
@ -461,11 +461,11 @@ table.listing {
} }
.prev { .prev {
float: left; float: inline-start;
} }
.next { .next {
float: right; float: inline-end;
} }
} }
@ -484,7 +484,7 @@ table.listing {
} }
.filter-title { .filter-title {
float: left; float: inline-start;
font-size: 0.95em; font-size: 0.95em;
padding: 1em; padding: 1em;
margin: 0 1em 0 0; margin: 0 1em 0 0;
@ -498,7 +498,7 @@ table.listing {
li { li {
padding: 0.8em; padding: 0.8em;
float: left; float: inline-start;
} }
&__icon { &__icon {
@ -532,7 +532,7 @@ table.listing {
border: 0; border: 0;
.bulk-action-checkbox { .bulk-action-checkbox {
float: left; float: inline-start;
margin: -0.5em 0.5em 0.5em -0.75em; margin: -0.5em 0.5em 0.5em -0.75em;
} }

View File

@ -18,7 +18,7 @@
} }
&__actions > div { &__actions > div {
float: right; float: inline-end;
display: block; display: block;
margin-inline-end: theme('spacing.3'); margin-inline-end: theme('spacing.3');
} }

View File

@ -41,7 +41,7 @@
} }
.xdsoft_datepicker { .xdsoft_datepicker {
float: left; float: inline-start;
margin-inline-start: 8px; margin-inline-start: 8px;
} }
@ -90,7 +90,7 @@
} }
.xdsoft_prev { .xdsoft_prev {
float: left; float: inline-start;
&:before { &:before {
mask-image: url('#{$images-root}icons/arrow-left.svg'); mask-image: url('#{$images-root}icons/arrow-left.svg');
@ -98,7 +98,7 @@
} }
.xdsoft_today_button { .xdsoft_today_button {
float: left; float: inline-start;
margin-inline-start: 5px; margin-inline-start: 5px;
&:before { &:before {
@ -107,7 +107,7 @@
} }
.xdsoft_next { .xdsoft_next {
float: right; float: inline-end;
&:before { &:before {
mask-image: url('#{$images-root}icons/arrow-right.svg'); mask-image: url('#{$images-root}icons/arrow-right.svg');
@ -116,7 +116,7 @@
.xdsoft_timepicker { .xdsoft_timepicker {
min-width: 70px; min-width: 70px;
float: left; float: inline-start;
text-align: center; text-align: center;
margin-inline-start: 8px; margin-inline-start: 8px;
margin-top: 0; margin-top: 0;
@ -176,7 +176,7 @@
line-height: 20px; line-height: 20px;
font-weight: bold; font-weight: bold;
background-color: theme('colors.surface-page'); background-color: theme('colors.surface-page');
float: left; float: inline-start;
width: 182px; width: 182px;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;

View File

@ -21,7 +21,7 @@ $padding: math.div($grid-gutter-width, 2);
// Our column container // Our column container
@mixin column($x, $padding: $padding, $grid-columns: $grid-columns) { @mixin column($x, $padding: $padding, $grid-columns: $grid-columns) {
display: inline; display: inline;
float: left; float: inline-start;
width: 100% * math.div($x, $grid-columns); width: 100% * math.div($x, $grid-columns);
padding-inline-end: $padding; padding-inline-end: $padding;
padding-inline-start: $padding; padding-inline-start: $padding;

View File

@ -82,7 +82,7 @@
margin-top: 10px; margin-top: 10px;
button { button {
float: right; float: inline-end;
} }
&::after { &::after {
@ -104,7 +104,7 @@
button { button {
height: 26px; height: 26px;
float: right; float: inline-end;
margin-inline-start: 5px; margin-inline-start: 5px;
color: theme('colors.white.DEFAULT'); color: theme('colors.white.DEFAULT');
background-color: theme('colors.critical.200'); background-color: theme('colors.critical.200');

View File

@ -32,7 +32,7 @@
} }
&__action { &__action {
float: left; float: inline-start;
margin-inline-start: 5px; margin-inline-start: 5px;
border-radius: 5px; border-radius: 5px;
width: 30px; width: 30px;

View File

@ -67,7 +67,7 @@
margin-top: 10px; margin-top: 10px;
button { button {
float: right; float: inline-end;
} }
&::after { &::after {
@ -89,7 +89,7 @@
button { button {
height: 26px; height: 26px;
float: right; float: inline-end;
margin-inline-start: 5px; margin-inline-start: 5px;
color: theme('colors.white.DEFAULT'); color: theme('colors.white.DEFAULT');
background-color: theme('colors.critical.200'); background-color: theme('colors.critical.200');

View File

@ -13,7 +13,7 @@ class WordCountController extends Controller {
const output = document.createElement('output'); const output = document.createElement('output');
output.setAttribute('name', 'word-count'); output.setAttribute('name', 'word-count');
output.setAttribute('for', this.element.id); output.setAttribute('for', this.element.id);
output.style.float = 'right'; output.style.float = 'inline-end';
this.element.insertAdjacentElement('beforebegin', output); this.element.insertAdjacentElement('beforebegin', output);
this.output = output; this.output = output;
this.updateCount(); this.updateCount();

View File

@ -184,7 +184,7 @@ module.exports = {
], ],
corePlugins: { corePlugins: {
...vanillaRTL.disabledCorePlugins, ...vanillaRTL.disabledCorePlugins,
// Disable float and clear which have poor RTL support. // Disable float and clear. Use Flexbox or Grid instead.
float: false, float: false,
clear: false, clear: false,
// Disable text-transform so we dont rely on uppercasing text. // Disable text-transform so we dont rely on uppercasing text.

View File

@ -622,7 +622,7 @@ Edit your blog page template `blog_page.html` to include the images section:
<!-- Add this: --> <!-- Add this: -->
{% for item in page.gallery_images.all %} {% for item in page.gallery_images.all %}
<div style="float: left; margin: 10px"> <div style="float: inline-start; margin: 10px">
{% image item.image fill-320x240 %} {% image item.image fill-320x240 %}
<p>{{ item.caption }}</p> <p>{{ item.caption }}</p>
</div> </div>
@ -793,7 +793,7 @@ Finally, migrate your database by running `python manage.py makemigrations` and
{{ page.body|richtext }} {{ page.body|richtext }}
{% for item in page.gallery_images.all %} {% for item in page.gallery_images.all %}
<div style="float: left; margin: 10px"> <div style="float: inline-start; margin: 10px">
{% image item.image fill-320x240 %} {% image item.image fill-320x240 %}
<p>{{ item.caption }}</p> <p>{{ item.caption }}</p>
</div> </div>

View File

@ -72,14 +72,14 @@
} }
body[yahoo] .img { body[yahoo] .img {
width: 130px !important; width: 130px !important;
float:left; float: inline-start;
} }
body[yahoo] .img img { body[yahoo] .img img {
width:100% !important; width:100% !important;
} }
body[yahoo] .text { body[yahoo] .text {
width: 150px !important; width: 150px !important;
float:right; float: inline-end;
} }
{% endblock %} {% endblock %}
</style> </style>