Projet

Général

Profil

0001-scss-use-more-bulletproof-selector-for-float-grid-el.patch

Thomas Jund, 15 juin 2021 18:41

Télécharger (2,56 ko)

Voir les différences:

Subject: [PATCH] scss: use more bulletproof selector for float grid elements
 (#54904)

 static/includes/_grid.scss | 79 +++++++++++++++++++-------------------
 1 file changed, 40 insertions(+), 39 deletions(-)
static/includes/_grid.scss
1 1
$grid-gutter: 1rem !default;
2 2

  
3
div.cell[class*=grid-],
4
div.dataview div[class*=grid-],
5
form.quixote div[class*=grid-] {
6
	clear: none;
7
	&.newline {
8
		clear: both;
9
	}
10
}
11 3

  
12
div[class*=grid-] {
4
div[class^='grid-'],
5
div[class*=' grid-'] {
13 6
	float: left;
14 7
	padding-right: $grid-gutter;
15 8
	@media screen and (max-width: $very-small-limit) {
......
28 21
	&.newline {
29 22
		clear: both;
30 23
	}
31
}
32 24

  
33
div.dataview div[class*=grid-],
34
form div[class*=grid-] {
35
	@if $grid-gutter != 0px {
36
		box-sizing: content-box;
37
	} @else {
38
		padding-right: 1rem;  // force gutter for form fields
39
	}
40
	~ h3, ~ h4 {
41
		// give additional padding to compensate the margin being
42
		// "absorbed" by the floating element.
43
		padding-top: 1rem;
25
	&.cell,
26
	div.dataview &,
27
	form.quixote & {
28
		clear: none;
29
		&.newline {
30
			clear: both;
31
		}
44 32
	}
45
}
46 33

  
47
form div[class*=grid-] {
48
	~ h3, ~ h4, ~ p, + div {
49
		clear: both;
34
	div.dataview &,
35
	form & {
36
		@if $grid-gutter != 0px {
37
			box-sizing: content-box;
38
		} @else {
39
			padding-right: 1rem;  // force gutter for form fields
40
		}
41
		~ h3, ~ h4 {
42
			// give additional padding to compensate the margin being
43
			// "absorbed" by the floating element.
44
			padding-top: 1rem;
45
		}
50 46
	}
51
}
52 47

  
53
div.dataview div[class*=grid-] {
54
	~ div.title, ~ div.subtitle {
55
		clear: both;
48
	form & {
49
		~ h3, ~ h4, ~ p, + div {
50
			clear: both;
51
		}
52
		span.select2-selection,
53
		div.select2-container {
54
			width: 100% !important;
55
		}
56 56
	}
57
}
58 57

  
59
form div[class*=grid-] span.select2-selection,
60
form div[class*=grid-] div.select2-container {
61
	width: 100% !important;
62
}
58
	div.dataview & {
59
		~ div.title, ~ div.subtitle {
60
			clear: both;
61
		}
62
	}
63 63

  
64
@if $grid-gutter != 0px {
65
	// only define property if some gutter is requested
66
	.gru-content #columns > .cell[class*=grid-] {
67
		padding-right: 0;
68
		margin-right: $grid-gutter;
64
	@if $grid-gutter != 0px {
65
		// only define property if some gutter is requested
66
		.gru-content #columns > &.cell {
67
			padding-right: 0;
68
			margin-right: $grid-gutter;
69
		}
69 70
	}
70 71
}
71 72

  
72
-