docbrown/app/assets/stylesheets/widgets.scss
Ben Halpern a5e8ed66ee
Fix inconsistencies with DisplayAd (#14789)
* Fix inconsistencies with DisplayAd

* Remove console log

* Fix tests

* Fix width/height being backwards

* Stub FastImage

* Update app/services/html/parser.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Update spec/factories/display_ads.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Fix display language

* Add check for img

* Change name of rotatingDisplayUnits

* Update app/helpers/display_ad_helper.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-09-28 09:22:07 -04:00

365 lines
7.1 KiB
SCSS

// Sidebar widgets
@import 'config/import';
@import 'variables';
@import '_mixins';
// Sidebar Widgets
.widget {
position: relative;
overflow: hidden;
display: block;
padding: 0 16px 16px 16px;
margin: 8px 0 16px 0;
&:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 1px;
background: var(--card-color-tertiary);
opacity: 0.25;
}
&.fixed-widget {
position: sticky;
width: 254px;
top: 80px;
header {
padding-left: 6px;
}
}
&:hover {
opacity: 1;
}
&.showing {
display: block;
}
&.podcast-pic-widget {
a {
color: var(--body-color);
}
.widget-body {
padding-bottom: 10px;
}
.podcast-pic {
display: flex;
align-items: center;
position: relative;
padding: 5px 0px;
border-top-left-radius: 100px;
border-bottom-left-radius: 100px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
img {
visibility: visible;
width: 23px;
height: 23px;
border-radius: 100px;
vertical-align: -7px;
margin-left: 3px;
}
.podcast-name {
width: calc(100% - 55px);
display: inline-block;
padding-left: 4px;
font-weight: bold;
.podcast-name-inner {
font-size: 14px;
line-height: 15px;
display: block;
padding-left: 2px;
}
}
&:hover {
@include themeable(
background,
theme-container-background-hover,
$light-gray
);
}
}
}
hr {
opacity: 0.2;
}
header,
.widget--header {
position: relative;
font-size: 0.9em;
font-weight: bold;
padding: 8px 0;
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier,
monospace;
color: var(--card-color);
a {
display: inline-block;
color: var(--card-color);
h4 {
display: inline-block;
margin: 0;
}
&:hover {
text-decoration: underline;
}
}
.emoji {
margin-right: 6px;
display: inline-block;
vertical-align: -4px;
img {
width: 18px;
border: 0px;
cursor: default;
}
}
.widget-listing-live-count {
@include themeable(background, theme-secondary-color, $green);
color: var(--base-inverted);
border-radius: 3px;
display: inline-block;
font-size: 0.8em;
padding: 1px 5px 0px;
line-height: 1.4em;
}
.widget-minimize-button {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
background: transparent;
padding: 0px 5px 1px;
border-radius: 3px;
font-size: 1.2em;
line-height: 0.6em;
@include themeable(
border,
theme-secondary-color-border,
1px solid $light-medium-gray
);
@include themeable(
color,
theme-secondary-color,
darken($light-medium-gray, 10%)
);
}
}
.widget-body {
overflow-wrap: break-word;
&.body-scrollable {
height: calc(100vh - 300px);
max-height: 390px;
overflow-y: scroll;
}
&.widget-body--sponsorship-arbitrary img {
width: 100%;
}
.widget-podcast-ep {
padding-bottom: 8px;
a {
color: var(--body-color);
font-weight: 500;
}
}
.widget-podcast-title {
margin-top: -2px;
a {
color: $medium-gray;
font-size: 0.83em;
opacity: 0.86;
}
}
.widget-listing-link {
@include sidebar-link;
.widget-listing-link-title {
display: block;
}
.widget-listing-link-category {
display: inline-block;
color: var(--card-color-tertiary);
font-size: 0.8em;
line-height: 1;
}
}
.widget-accent {
background: $purple;
color: $bold-blue;
padding: 1px 5px;
border-radius: 3px;
margin-right: 1px;
}
.widget-footer {
color: $medium-gray;
font-size: 0.9em;
padding: 5px 0px 0px;
img {
height: 15px;
width: 15px;
vertical-align: -2px;
display: inline;
border: 0;
}
}
.widget-subtext {
padding: 0;
margin: 0;
color: var(--card-color-tertiary);
font-size: 0.85em;
}
.widget-user-pic {
display: inline-block;
img {
height: 48px;
width: 48px;
margin: 0 8px 8px 0;
border-radius: 100%;
}
}
// Listings
.widget-listing-category {
color: $medium-gray;
}
.widget-listing-title {
font-family: var(--ff-sans-serif);
font-weight: 500;
margin-bottom: 8px;
}
}
p {
margin: 8px 0;
}
ul {
padding-left: 10px;
display: flex;
flex-direction: column;
}
li {
font-size: 1em;
line-height: 1.32em;
display: inline-block;
&::before {
font-size: 1.2em;
}
}
ul {
img {
width: 5%;
border: none;
padding-right: 4px;
visibility: hidden;
}
}
a {
&:hover {
opacity: 0.9;
}
}
.row {
position: relative;
overflow: hidden;
padding: 1px 0px 3px;
font-size: 0.97em;
.key {
float: left;
width: 20px;
font-size: 0.8em;
padding: 2px;
}
.value {
float: left;
width: calc(100% - 42px);
padding: 5px 7px;
}
}
}
// Sidebar sponsors
.sidebar-sponsor {
color: var(--card-color-tertiary);
img {
width: 100%;
max-width: 140px;
margin-bottom: var(--su-2);
}
}
// Left Side bar navigation links
// Pulling this out of context because Nick says so: https://github.com/thepracticaldev/dev.to/pull/5918/commits/f1642e62accbdaff72dc7762e1e1ffd4e40027b0
.sidebar-nav-element {
display: block;
position: relative;
a {
display: block;
overflow-x: hidden;
text-overflow: ellipsis;
}
@media screen and (min-width: $breakpoint-m) {
.sidebar-nav-link-follow {
display: none;
}
&:hover {
.sidebar-nav-link-follow {
display: block;
}
}
}
img {
width: 30px;
height: 30px;
border: 0px;
vertical-align: -8px;
margin-right: 4px;
}
img.nav-emoji {
height: 19px;
width: 19px;
vertical-align: -2px;
}
a.sidebar-nav-link {
@include sidebar-link;
color: var(--link-color);
font-weight: 400;
&.sidebar-nav-link-tag {
color: var(--link-color);
}
}
a.sidebar-nav-link-follow {
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
}
}
// Todo: Not really sure what that is.. some sort of sponsorship widget...
.sidebar-sponsorship-level {
text-align: center;
font-weight: bold;
width: calc(100% - 6px);
padding: 26px 0px;
border-radius: 3px;
margin-bottom: 10px;
font-family: $helvetica-condensed;
font-stretch: condensed;
background: var(--card-secondary-bg);
}
.crayons-sponsorship-widget {
img {
width: 100%;
height: auto;
border-radius: var(--radius);
display: inline-block;
vertical-align: middle;
margin: 10px auto;
}
}