Skip to content

Commit

Permalink
Enforce double-colon notation for CSS pseudo-elements
Browse files Browse the repository at this point in the history
These changes are part of https://phabricator.services.mozilla.com/D170496, and thanks to a Stylelint rule we can both enforce and fix this automatically; see also https://stylelint.io/user-guide/rules/selector-pseudo-element-colon-notation/
  • Loading branch information
Snuffleupagus committed Apr 18, 2023
1 parent 88e2d04 commit 529dbf9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
1 change: 1 addition & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"length-zero-no-unit": [true, {
ignore: ["custom-properties"]
}],
"selector-pseudo-element-colon-notation": "double",
"shorthand-property-no-redundant-values": true,
},
}
16 changes: 8 additions & 8 deletions web/annotation_layer_builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -192,31 +192,31 @@
outline: var(--input-focus-outline);
}

.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after,
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {
background-color: CanvasText;
content: "";
display: block;
position: absolute;
}

.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {
height: 80%;
left: 45%;
width: 1px;
}

.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before {
transform: rotate(45deg);
}

.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {
transform: rotate(-45deg);
}

.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {
border-radius: 50%;
height: 50%;
left: 30%;
Expand Down
6 changes: 3 additions & 3 deletions web/pdf_viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
height: 100%;
}

.pdfViewer .page.loadingIcon:after {
.pdfViewer .page.loadingIcon::after {
position: absolute;
top: 0;
left: 0;
Expand All @@ -184,11 +184,11 @@
contain: strict;
}

.pdfViewer .page.loading:after {
.pdfViewer .page.loading::after {
display: block;
}

.pdfViewer .page:not(.loading):after {
.pdfViewer .page:not(.loading)::after {
transition-property: none;
display: none;
}
Expand Down
20 changes: 10 additions & 10 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,10 @@ body {
0 0 0 1px var(--doorhanger-border-color);
border: var(--doorhanger-border-color-whcm);
}
.doorHanger:after,
.doorHanger:before,
.doorHangerRight:after,
.doorHangerRight:before {
.doorHanger::after,
.doorHanger::before,
.doorHangerRight::after,
.doorHangerRight::before {
bottom: 100%;
border: 8px solid rgba(0, 0, 0, 0);
content: " ";
Expand All @@ -613,26 +613,26 @@ body {
pointer-events: none;
opacity: var(--doorhanger-triangle-opacity-whcm);
}
.doorHanger:after {
.doorHanger::after {
inset-inline-start: 10px;
margin-inline-start: -8px;
border-bottom-color: var(--toolbar-bg-color);
}
.doorHangerRight:after {
.doorHangerRight::after {
inset-inline-end: 10px;
margin-inline-end: -8px;
border-bottom-color: var(--doorhanger-bg-color);
}
.doorHanger:before,
.doorHangerRight:before {
.doorHanger::before,
.doorHangerRight::before {
border-bottom-color: var(--doorhanger-border-color);
border-width: 9px;
}
.doorHanger:before {
.doorHanger::before {
inset-inline-start: 10px;
margin-inline-start: -9px;
}
.doorHangerRight:before {
.doorHangerRight::before {
inset-inline-end: 10px;
margin-inline-end: -9px;
}
Expand Down

0 comments on commit 529dbf9

Please sign in to comment.