Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewire CSS to use new classes and clean up. #31

Merged
merged 5 commits into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 57 additions & 57 deletions src/components/results/_pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,81 +38,81 @@
@include breakpoint($bp2) {
margin-right: rhythm(.25);
}
}

// Link styles
a {
@include trans();
@include adjust-font-size-to(.9em, 1);
font-weight: 700;
display: flex;
justify-content: center;
align-items: center;
border: 0;
text-align: center;
padding: rhythm(.25);

@include breakpoint($bp0) {
background-color: $c-secondary;
color: $white;
border-radius: 3px;
width: rhythm(1.5);
height: rhythm(1.5);
padding: 0;
}
// Active page
.search-pager__item.is-active .search-pager__item-link {
@include adjust-font-size-to($text, 1);

@include breakpoint($bp2) {
@include adjust-font-size-to($label, .9);
width: rhythm(1.2);
height: rhythm(1.2);
}
@include breakpoint($bp0) {
background-color: $link-color;
color: $white;

&:hover,
&:active {
text-decoration: underline;
color: $white;
background-color: $c-secondary;

@include breakpoint($bp0) {
@include adjust-font-size-to($text, 1);
background-color: $c-secondary-dark;
}

svg {
fill: $c-primary-dark;
}
background-color: $c-primary-dark;
}
}
}

svg {
height: 1.3em;
fill: $white;
display: block;
.search-pager__item.not-active .search-pager__item-link {
display: none;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nstriedinger can you walk me through this change? Is this just a result from copy/pasting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jesconstantine this is just like the original file. I just tried to organize it so it would be easy to grok through.


@include breakpoint($bp0) {
height: 1em;
}
}
@include breakpoint($bp0) {
display: inline-block;
}
}

// Link styles
.search-pager__item-link {
@include trans();
@include adjust-font-size-to(.9em, 1);
font-weight: 700;
display: flex;
justify-content: center;
align-items: center;
border: 0;
text-align: center;
padding: rhythm(.25);

@include breakpoint($bp0) {
background-color: $c-secondary;
color: $white;
border-radius: 3px;
width: rhythm(1.5);
height: rhythm(1.5);
padding: 0;
}

@include breakpoint($bp2) {
@include adjust-font-size-to($label, .9);
width: rhythm(1.2);
height: rhythm(1.2);
}

// Active page
&.is-active a {
@include adjust-font-size-to($text, 1);
&:hover,
&:active {
text-decoration: underline;
color: $white;
background-color: $c-secondary;

@include breakpoint($bp0) {
background-color: $link-color;
color: $white;
@include adjust-font-size-to($text, 1);
background-color: $c-secondary-dark;
}

&:hover,
&:active {
background-color: $c-primary-dark;
}
svg {
fill: $c-primary-dark;
}
}

&.not-active {
display: none;
svg {
height: 1.3em;
fill: $white;
display: block;

@include breakpoint($bp0) {
display: inline-block;
height: 1em;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nstriedinger can you walk me through this change too? Does this just happen to look like a change in the css rule because of how things were rearranged or is an actual change?

}
}
}
50 changes: 24 additions & 26 deletions src/components/results/_search-results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* search-form.scss
* Define search results styles.
*
* @copyright Copyright (c) 2017 Palantir.net
* @copyright Copyright (c) 2019 Palantir.net
*/

.search-results {
Expand Down Expand Up @@ -47,33 +47,31 @@
margin-top: .25em;
padding: 0;
line-height: calc(100% + 50%);
}

a {
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
@include trans();
background-color: transparent; /* 1 */
/* stylelint-disable property-no-vendor-prefix */
-webkit-text-decoration-skip: objects; /* 2 */
/* stylelint-enable */
color: $link-color;
text-decoration: none;
border-bottom: 2px dashed $link-color;

/**
* Remove the outline on focused links when they are also active or hovered
* in all browsers (opinionated).
*/
.search-results__heading-link {
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
@include trans();
background-color: transparent; /* 1 */
/* stylelint-disable property-no-vendor-prefix */
-webkit-text-decoration-skip: objects; /* 2 */
/* stylelint-enable */
color: $link-color;
text-decoration: none;

&:active,
&:hover {
outline-width: 0;
color: $link-hover;
background-color: $gray-light;
border-bottom: 2px solid $link-hover;
}
/**
* Remove the outline on focused links when they are also active or hovered
* in all browsers (opinionated).
*/
&:active,
&:hover {
outline-width: 0;
color: $link-hover;
background-color: $gray-light;
border-bottom: 2px solid $link-hover;
}
}

Expand Down
161 changes: 82 additions & 79 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ aside {
* search-form.scss
* Define search results styles.
*
* @copyright Copyright (c) 2017 Palantir.net
* @copyright Copyright (c) 2019 Palantir.net
*/
.search-results li {
margin-bottom: 1.46667em;
Expand Down Expand Up @@ -1412,30 +1412,30 @@ aside {
margin-top: .25em;
padding: 0;
line-height: calc(100% + 50%); }
.search-results__heading a {
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
transition: all 0.3s ease;
background-color: transparent;
/* 1 */
/* stylelint-disable property-no-vendor-prefix */
-webkit-text-decoration-skip: objects;
/* 2 */
/* stylelint-enable */
color: #737373;
text-decoration: none;
border-bottom: 2px dashed #737373;
/**
* Remove the outline on focused links when they are also active or hovered
* in all browsers (opinionated).
*/ }
.search-results__heading a:active, .search-results__heading a:hover {
outline-width: 0;
color: black;
background-color: #e5e5e5;
border-bottom: 2px solid black; }

.search-results__heading-link {
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
transition: all 0.3s ease;
background-color: transparent;
/* 1 */
/* stylelint-disable property-no-vendor-prefix */
-webkit-text-decoration-skip: objects;
/* 2 */
/* stylelint-enable */
color: #737373;
text-decoration: none;
/**
* Remove the outline on focused links when they are also active or hovered
* in all browsers (opinionated).
*/ }
.search-results__heading-link:active, .search-results__heading-link:hover {
outline-width: 0;
color: black;
background-color: #e5e5e5;
border-bottom: 2px solid black; }

.search-results__teaser {
margin-bottom: 0.73333em; }
Expand Down Expand Up @@ -1577,63 +1577,66 @@ aside {
@media (min-width: 900px) {
.search-pager__item {
margin-right: 0.36667em; } }
.search-pager__item a {
transition: all 0.3s ease;
font-size: 0.9em;
line-height: 1.62963em;
font-weight: 700;
display: flex;
justify-content: center;
align-items: center;
border: 0;
text-align: center;
padding: 0.36667em; }
@media (min-width: 450px) {
.search-pager__item a {
background-color: #0000ff;
color: #fff;
border-radius: 3px;
width: 2.2em;
height: 2.2em;
padding: 0; } }
@media (min-width: 900px) {
.search-pager__item a {
font-size: 0.8em;
line-height: 1.65em;
width: 1.76em;
height: 1.76em; } }
.search-pager__item a:hover, .search-pager__item a:active {
text-decoration: underline;

.search-pager__item.is-active .search-pager__item-link {
font-size: 1em;
line-height: 1.46667em; }
@media (min-width: 450px) {
.search-pager__item.is-active .search-pager__item-link {
background-color: #737373;
color: #fff; }
.search-pager__item.is-active .search-pager__item-link:hover, .search-pager__item.is-active .search-pager__item-link:active {
background-color: black; } }

.search-pager__item.not-active .search-pager__item-link {
display: none; }
@media (min-width: 450px) {
.search-pager__item.not-active .search-pager__item-link {
display: inline-block; } }

.search-pager__item-link {
transition: all 0.3s ease;
font-size: 0.9em;
line-height: 1.62963em;
font-weight: 700;
display: flex;
justify-content: center;
align-items: center;
border: 0;
text-align: center;
padding: 0.36667em; }
@media (min-width: 450px) {
.search-pager__item-link {
background-color: #0000ff;
color: #fff;
background-color: #0000ff; }
@media (min-width: 450px) {
.search-pager__item a:hover, .search-pager__item a:active {
font-size: 1em;
line-height: 1.46667em;
background-color: navy; } }
.search-pager__item a:hover svg, .search-pager__item a:active svg {
fill: black; }
.search-pager__item a svg {
height: 1.3em;
fill: #fff;
display: block; }
@media (min-width: 450px) {
.search-pager__item a svg {
height: 1em; } }
.search-pager__item.is-active a {
font-size: 1em;
line-height: 1.46667em; }
border-radius: 3px;
width: 2.2em;
height: 2.2em;
padding: 0; } }
@media (min-width: 900px) {
.search-pager__item-link {
font-size: 0.8em;
line-height: 1.65em;
width: 1.76em;
height: 1.76em; } }
.search-pager__item-link:hover, .search-pager__item-link:active {
text-decoration: underline;
color: #fff;
background-color: #0000ff; }
@media (min-width: 450px) {
.search-pager__item.is-active a {
background-color: #737373;
color: #fff; }
.search-pager__item.is-active a:hover, .search-pager__item.is-active a:active {
background-color: black; } }
.search-pager__item.not-active {
display: none; }
.search-pager__item-link:hover, .search-pager__item-link:active {
font-size: 1em;
line-height: 1.46667em;
background-color: navy; } }
.search-pager__item-link:hover svg, .search-pager__item-link:active svg {
fill: black; }
.search-pager__item-link svg {
height: 1.3em;
fill: #fff;
display: block; }
@media (min-width: 450px) {
.search-pager__item.not-active {
display: inline-block; } }
.search-pager__item-link svg {
height: 1em; } }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nstriedinger can you walk me through this change too? Does this just happen to look like a change in the css rule because of how things were rearranged or is an actual change?


/**
* search-results-stat.scss
Expand Down