Skip to content

Commit

Permalink
Consolidate CSS shorthand | Double colon pseudoelements to drop IE8 s…
Browse files Browse the repository at this point in the history
…upport
  • Loading branch information
anselmbradford committed Aug 4, 2023
1 parent b9c4f66 commit e3ab41b
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion cfgov/unprocessed/css/atoms/partially-styled-link.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

.a-link__partially-styled {
border-bottom-width: 0px;
border-bottom-width: 0;

&_plain {
color: @black;
Expand Down
8 changes: 4 additions & 4 deletions cfgov/unprocessed/css/calendar-icon.less
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
line-height: 1;
text-align: center;

&:before,
&:after {
&::before,
&::after {
// Display & Box Model.
display: block;
}

&:before {
&::before {
// Display & Box Model.
padding-bottom: 0.15em;

Expand All @@ -63,7 +63,7 @@
content: @month;
}

&:after {
&::after {
// Display & Box Model.
padding: 0.15em 0 0;
border-radius: 0 0 0.16em 0.16em;
Expand Down
6 changes: 3 additions & 3 deletions cfgov/unprocessed/css/enhancements/layout-2-1.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
position: relative;

// Create the hero background bleed.
&:after {
&::after {
.u-hero-background();
}
}
Expand Down Expand Up @@ -84,7 +84,7 @@
margin-left: unit(-15px / @base-font-size-px, rem);

// This is the sidebar background, which bleeds to the edge.
&:after {
&::after {
.u-sidebar-background();
left: 0;
}
Expand Down Expand Up @@ -120,7 +120,7 @@
margin-right: unit(-15px / @base-font-size-px, rem);

// This is the sidebar background, which bleeds to the edge.
&:after {
&::after {
.u-sidebar-background();
right: 0;
left: auto;
Expand Down
2 changes: 1 addition & 1 deletion cfgov/unprocessed/css/enhancements/typography.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dd {
display: inline;
margin-left: 0.2em;

&:after {
&::after {
display: block;
content: '';
}
Expand Down
2 changes: 1 addition & 1 deletion cfgov/unprocessed/css/misc.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.u-drop-shadow-after() {
&:after {
&::after {
display: block;
height: 5px;
width: 100%;
Expand Down
1 change: 1 addition & 0 deletions cfgov/unprocessed/css/molecules/global-search.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// TODO: Move the theme variables to /enhancements/ for CF.

/* topdoc
name: Theme variables
family: cf-core
Expand Down
2 changes: 1 addition & 1 deletion cfgov/unprocessed/css/molecules/related-metadata.less
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
.u-link__colors(@gray, @gray, @gray, @gray, @gray,
@gold-80, @gold-80, @gold-80, @gold-80, @gold-80);

&:before {
&::before {
position: absolute;
left: -@bullet-font-size__em;
width: @bullet-font-size__em;
Expand Down
1 change: 1 addition & 0 deletions cfgov/unprocessed/css/on-demand/ask.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import (reference) '../main.less';

/* ==========================================================================
consumerfinance.gov
Ask CFPB pages at /ask-cfpb/.
Expand Down
1 change: 1 addition & 0 deletions cfgov/unprocessed/css/on-demand/error.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import (reference) '../main.less';

/* ==========================================================================
consumerfinance.gov
Page-specific styles for the error pages.
Expand Down
6 changes: 3 additions & 3 deletions cfgov/unprocessed/css/on-demand/event.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/* Event-Agenda Table
========================================================================== */
.event-agenda_table {
h2 + & td[data-label]:before {
h2 + & td[data-label]::before {
margin-top: 0;
}

Expand Down Expand Up @@ -72,8 +72,8 @@
text-transform: capitalize;
display: inline-block;

.event-meta_street:not(:empty):after,
.event-meta_suite:not(:empty):after {
.event-meta_street:not(:empty)::after,
.event-meta_suite:not(:empty)::after {
// Adding a linebreak after the street if it's contents
// aren't empty.
content: '\A';
Expand Down
1 change: 1 addition & 0 deletions cfgov/unprocessed/css/organisms/header.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// TODO: Move the theme variables to cf-enhancements.

/* topdoc
name: Theme variables
family: cf-core
Expand Down
19 changes: 10 additions & 9 deletions cfgov/unprocessed/css/organisms/mega-menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ body {
.u-bar-left( @color, @position: -@menu_link_hover_bar_px - 10px ) {
position: relative;

&:before {
&::before {
position: absolute;
left: @position;
top: 0;
Expand All @@ -221,12 +221,12 @@ body {
}

// Make the pseudo-element have an outline.
&:focus:after {
&:focus::after {
outline: 1px dotted @pacific;
}

// Create the dimensions for the pseudo-element focus rectangle.
&:after {
&::after {
position: absolute;
left: 0;
top: 0;
Expand Down Expand Up @@ -300,7 +300,7 @@ body {
.u-focus-link-desktop() {
.u-focus-rectangle();

&:after {
&::after {
left: -@menu_link_hover_bar_px - 9px;
width: calc(100% + @menu_link_hover_bar_px + 6px);
}
Expand All @@ -310,7 +310,7 @@ body {
.u-focus-overview-link-desktop() {
.u-focus-rectangle();

&:after {
&::after {
left: -@menu_link_hover_bar_px - 9px;
width: calc(100% + @menu_link_hover_bar_px + 9px);
}
Expand All @@ -320,7 +320,7 @@ body {
.u-focus-link-icon-desktop() {
.u-focus-rectangle();

&:after {
&::after {
left: -@menu_link_hover_bar_px - 7px;
width: calc(100% + @menu_link_hover_bar_px + 6px);
}
Expand All @@ -330,7 +330,7 @@ body {
.u-focus-link-featured-desktop() {
.u-focus-rectangle();

&:after {
&::after {
left: -@menu_link_hover_bar_px;
width: calc(100% + @menu_link_hover_bar_px + 5px);
}
Expand All @@ -340,7 +340,7 @@ body {
.u-focus-link-mobile() {
.u-focus-rectangle();

&:after {
&::after {
left: -@menu_link_hover_bar_px - 9px;
width: calc(100% + @menu_link_hover_bar_px + 14px);
}
Expand Down Expand Up @@ -1102,7 +1102,8 @@ body {
} );

// Large desktop size. 1021px. Not currently used.
/*.respond-to-min( @bp-lg-min, { } );*/

/* .respond-to-min( @bp-lg-min, { } ); */

// Xtra-Large desktop size. 1261px.
.respond-to-min( @bp-xl-min + @grid_gutter-width, {
Expand Down
2 changes: 1 addition & 1 deletion cfgov/unprocessed/css/search.less
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}
}
.content_main {
&:after {
&::after {
border: 0;
}
border: 0;
Expand Down

0 comments on commit e3ab41b

Please sign in to comment.