I'm trying to get this CSS file to have both .box-shadow and .card-box-shadow .pagebuilder-column on the same declaration but haven't really found a way, other than manually doing it in CSS which kinda defeats the purpose, I know it's a small thing and it may be the point where I should just do it in CSS but, there must be a way!
SCSS:
.box-shadow {
box-shadow: $box-shadow;
&--light {
box-shadow: $box-shadow--light;
}
&--strong {
box-shadow: $box-shadow--strong;
}
&__spread {
box-shadow: $box-shadow__spread;
&--light {
box-shadow: $box-shadow__spread--light;
}
&--strong {
box-shadow: $box-shadow__spread--strong;
}
}
&__concise {
box-shadow: $box-shadow__concise;
&--light {
box-shadow: $box-shadow__concise--light;
}
&--strong {
box-shadow: $box-shadow__concise--strong;
}
}
}
.card-box-shadow {
& .pagebuilder-column {
box-shadow: $box-shadow;
}
&--light {
& .pagebuilder-column {
box-shadow: $box-shadow--light;
}
}
&--strong {
& .pagebuilder-column {
box-shadow: $box-shadow--strong;
}
}
&__spread {
& .pagebuilder-column {
box-shadow: $box-shadow__spread;
}
&--light {
& .pagebuilder-column {
box-shadow: $box-shadow__spread--light;
}
}
&--strong {
& .pagebuilder-column {
box-shadow: $box-shadow__spread--strong;
}
}
}
&__concise {
& .pagebuilder-column {
box-shadow: $box-shadow__concise;
}
&--light {
& .pagebuilder-column {
box-shadow: $box-shadow__concise--light;
}
}
&--strong {
& .pagebuilder-column {
box-shadow: $box-shadow__concise--strong;
}
}
}
}
Current output:
.box-shadow {
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}
.box-shadow--light {
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px 4px;
}
.box-shadow--strong {
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 4px 8px 4px;
}
.box-shadow__spread {
box-shadow: rgba(0, 0, 0, 0.2) 0px 8px 28px 6px, rgba(0, 0, 0, 0.1) 0px 2px 4px 1px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px inset;
}
.box-shadow__spread--light {
box-shadow: rgba(0, 0, 0, 0.15) 0px 5px 15px 6px;
}
.box-shadow__spread--strong {
box-shadow: rgba(0, 0, 0, 0.56) 0px 15px 50px 6px;
}
.box-shadow__concise {
box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
}
.box-shadow__concise--light {
box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
}
.box-shadow__concise--strong {
box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px 3px, rgba(0, 0, 0, 0.23) 0px 3px 6px 3px;
}
.card-box-shadow .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}
.card-box-shadow--light .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px 4px;
}
.card-box-shadow--strong .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 4px 8px 4px;
}
.card-box-shadow__spread .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.2) 0px 8px 28px 6px, rgba(0, 0, 0, 0.1) 0px 2px 4px 1px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px inset;
}
.card-box-shadow__spread--light .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.15) 0px 5px 15px 6px;
}
.card-box-shadow__spread--strong .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.56) 0px 15px 50px 6px;
}
.card-box-shadow__concise .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
}
.card-box-shadow__concise--light .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
}
.card-box-shadow__concise--strong .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px 3px, rgba(0, 0, 0, 0.23) 0px 3px 6px 3px;
}
/*# sourceMappingURL=box-shadow.css.map */
Desired output:
.box-shadow,
.card-box-shadow .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}
.box-shadow--light,
.card-box-shadow--light .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px 4px;
}
.box-shadow__concise,
.card-box-shadow__concise .pagebuilder-column {
box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
}
.box-shadow__concise--light,
.card-box-shadow__concise--light .pagebuilder-column {
box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
}
So far this is the only way to make it output the same, is there a way of using a mixin to avoid this?
.box-shadow, .card-box-shadow .pagebuilder-column {
box-shadow: $box-shadow;
}
.box-shadow--light, .card-box-shadow--light .pagebuilder-column {
box-shadow: $box-shadow--light;
}
.box-shadow--strong, .card-box-shadow--strong .pagebuilder-column {
box-shadow: $box-shadow--strong;
}
.box-shadow__spread, .card-box-shadow__spread .pagebuilder-column {
box-shadow: $box-shadow__spread;
}
.box-shadow__spread--light, .card-box-shadow__spread--light .pagebuilder-column {
box-shadow: $box-shadow__spread--light;
}
.box-shadow__spread--strong, .card-box-shadow__spread--strong .pagebuilder-column {
box-shadow: $box-shadow__spread--strong;
}
.box-shadow__concise, .card-box-shadow__concise .pagebuilder-column {
box-shadow: $box-shadow__concise;
}
.box-shadow__concise--light, .card-box-shadow__concise--light .pagebuilder-column {
box-shadow: $box-shadow__concise--light;
}
.box-shadow__concise--strong, .card-box-shadow__concise--strong .pagebuilder-column {
box-shadow: $box-shadow__concise--strong;
}
After some trial and error this is what I went for:
//this is in the mixin file
#mixin box-shadow-color($color, $add-class: false, $name) {
$shadow-color: $color;
$box-shadow: set-box-shadow-color($shadow-color, 0.35) 0px 5px 15px;
$box-shadow--strong: set-box-shadow-color($shadow-color, 0.19) 0px 10px 20px,
set-box-shadow-color($shadow-color, 0.23) 0px 4px 8px 4px;
$box-shadow--light: set-box-shadow-color($shadow-color, 0.1) 0px 4px 12px 4px;
$box-shadow__concise--light: set-box-shadow-color($shadow-color, 0.25) 0px 2px 5px -1px,
set-box-shadow-color($shadow-color, 0.3) 0px 1px 3px -1px;
$box-shadow__concise: set-box-shadow-color($shadow-color, 0.16) 0px 3px 6px,
set-box-shadow-color($shadow-color, 0.23) 0px 3px 6px;
$box-shadow__concise--strong: set-box-shadow-color($shadow-color, 0.16) 0px 3px 6px 3px,
set-box-shadow-color($shadow-color, 0.23) 0px 3px 6px 3px;
$box-shadow__spread: set-box-shadow-color($shadow-color, 0.2) 0px 8px 28px 6px,
set-box-shadow-color($shadow-color, 0.1) 0px 2px 4px 1px,
set-box-shadow-color($shadow-color, 0.05) 0px 0px 0px 1px inset;
$box-shadow__spread--light: set-box-shadow-color($shadow-color, 0.15) 0px 5px 15px 6px;
$box-shadow__spread--strong: set-box-shadow-color($shadow-color, 0.56) 0px 15px 50px 6px;
#if $add-class {
.box-shadow--#{$name},
.card-box-shadow .pagebuilder-column {
box-shadow: $box-shadow;
}
.box-shadow--light--#{$name},
.card-box-shadow--light--#{$name} .pagebuilder-column {
box-shadow: $box-shadow--light;
}
.box-shadow--strong--#{$name},
.card-box-shadow--strong--#{$name} .pagebuilder-column {
box-shadow: $box-shadow--strong;
}
.box-shadow__spread--#{$name},
.card-box-shadow__spread--#{$name} .pagebuilder-column {
box-shadow: $box-shadow__spread;
}
.box-shadow__spread--light--#{$name},
.card-box-shadow__spread--light--#{$name} .pagebuilder-column {
box-shadow: $box-shadow__spread--light;
}
.box-shadow__spread--strong--#{$name},
.card-box-shadow__spread--strong--#{$name} .pagebuilder-column {
box-shadow: $box-shadow__spread--strong;
}
.box-shadow__concise--#{$name},
.card-box-shadow__concise--#{$name} .pagebuilder-column {
box-shadow: $box-shadow__concise;
}
.box-shadow__concise--light--#{$name},
.card-box-shadow__concise--light--#{$name} .pagebuilder-column {
box-shadow: $box-shadow__concise--light;
}
.box-shadow__concise--strong--#{$name},
.card-box-shadow__concise--strong--#{$name} .pagebuilder-column {
box-shadow: $box-shadow__concise--strong;
}
}
#else {
.box-shadow,
.card-box-shadow .pagebuilder-column {
box-shadow: $box-shadow;
}
.box-shadow--light,
.card-box-shadow--light .pagebuilder-column {
box-shadow: $box-shadow--light;
}
.box-shadow--strong,
.card-box-shadow--strong .pagebuilder-column {
box-shadow: $box-shadow--strong;
}
.box-shadow__spread,
.card-box-shadow__spread .pagebuilder-column {
box-shadow: $box-shadow__spread;
}
.box-shadow__spread--light,
.card-box-shadow__spread--light .pagebuilder-column {
box-shadow: $box-shadow__spread--light;
}
.box-shadow__spread--strong,
.card-box-shadow__spread--strong .pagebuilder-column {
box-shadow: $box-shadow__spread--strong;
}
.box-shadow__concise,
.card-box-shadow__concise .pagebuilder-column {
box-shadow: $box-shadow__concise;
}
.box-shadow__concise--light,
.card-box-shadow__concise--light .pagebuilder-column {
box-shadow: $box-shadow__concise--light;
}
.box-shadow__concise--strong,
.card-box-shadow__concise--strong .pagebuilder-column {
box-shadow: $box-shadow__concise--strong;
}
}
}
//box-shadow.scss file
#use "utilities" as *;
#include box-shadow-color($black, false, none);
I have my chart fiddle here. I want to make tooltip with an arrow. Can i do that in d3?attached fiddle of graph
css for the tooltip for now-
.hor_tooltip {
position: absolute;
width: 50px;
height: auto;
padding: 10px;
background-color: white;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
pointer-events: none;
display:none
You can add
.hor_tooltip:after {
left: 100%;
top: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(255, 255, 255, 0);
border-left-color: #ffffff;
border-width: 10px;
margin-top: -10px;
}
See https://jsfiddle.net/c74eoo2b/12/
I'm using this CSS to create a circular image 220px wide, centered within its container (a 3-column span of an 1180px grid):
.circular-image {
display: block;
margin: 0 auto;
width: 220px;
height: 220px;
border-radius: 110px;
-webkit-border-radius: 110px;
background: url(images/some-image.png);
box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}
And I know that you can cause images to automatically rescale using:
img {
height: auto;
}
How do I do this for circular images?
What is the exact problem with circular images? If you have problems with the "roundness" of the image you should change the border-radius property to a relative value:
.circular-image {
display: block;
margin: 0 auto;
width: 75%;
height: auto;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
background-color: red;
}
Here is a working jsFiddle.
border-radius: 50%; will make an element round for what ever size it is (so long as the width and height are the same).
I have an entertainment blog with a lot of pictures. Can someone please help me with a code that auto-numbers the pictures inside a post? (eg: www.chive.com, www.acidcow.com)
This is my CSS for pictures if it helps for anything...
.post-body img, .post-body .tr-caption-container, .Profile img, .Image img,
.BlogList .item-thumbnail img {
padding: $(image.border.small.size);
background: $(image.background.color);
border: 0px solid $(image.border.color);
-webkit-border-radius: 18px;
-moz-border-radius: 18px;
border-radius: 18px;
-moz-box-shadow: 1px 1px 5px rgba(0, 0, 0, .5);
-webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, .5);
box-shadow: 1px 1px 5px rgba(0, 0, 0, .5);}
I have the following CSS code :
#keyframes hvr_shadow
{
from
{
box-shadow: 0px 0px 4px rgba(60, 60, 60, 0.5);
}
to
{
box-shadow: 0px 0px 6px rgba(60, 60, 60, 0.8);
}
}
#-moz-keyframes hvr_shadow /* Firefox */
{
from
{
-moz-box-shadow: 0px 0px 4px rgba(60, 60, 60, 0.5);
}
to
{
-moz-box-shadow: 0px 0px 6px rgba(60, 60, 60, 0.8);
}
}
#-webkit-keyframes hvr_shadow /* Safari and Chrome */
{
from
{
-webkit-box-shadow: 0px 0px 4px rgba(60, 60, 60, 0.5);
}
to
{
-webkit-box-shadow: 0px 0px 6px rgba(60, 60, 60, 0.8);
}
}
#gallery .fancybox
{
border: 1px solid #333;
display: block;
padding: 0;
margin: 0;
height: 138px;
-moz-box-shadow: 0px 0px 4px rgba(60, 60, 60, 0.5);
-webkit-box-shadow: 0px 0px 0px rgba(60, 60, 60, 0.5);
box-shadow: 0px 0px 4px rgba(60, 60, 60, 0.5);
}
#gallery .fancybox:hover
{
animation: hvr_shadow 700ms;
-moz-animation: hvr_shadow 700ms; /* Firefox */
-webkit-animation: hvr_shadow 700ms; /* Safari and Chrome */
-o-animation: hvr_shadow 700ms; /* Opera */
}
While the animation is working, after a while the shadow auto return to primary settings.
How can I keep the settings of the animation while the mouse is still hovering the image ?
Here you can find a Fiddle demo : http://jsfiddle.net/haX8j/
This will solve your problem:
-webkit-animation: hvr_shadow 700ms .1s 1 ease-in-out normal forwards;
-moz-animation: hvr_shadow 700ms .1s 1 ease-in-out normal forwards;
-o-animation: hvr_shadow 700ms .1s 1 ease-in-out normal forwards;
animation: hvr_shadow 700ms .1s 1 ease-in-out normal forwards;
JS Fiddle: http://jsfiddle.net/haX8j/1/
Actually I think you are better off using a transition. It's far simpler, it works with Firefox and it will fade out correctly when moving off the link:
.link
{
-moz-box-shadow: 0px 0px 4px rgba(60, 60, 60, 0.5);
-webkit-box-shadow: 0px 0px 4px rgba(60, 60, 60, 0.5);
box-shadow: 0px 0px 4px rgba(60, 60, 60, 0.5);
-moz-transition: all 0.7s;
-webkit-transition: all 0.7s;
-o-transition: all 0.7s;
transition: all 0.7s;
}
.link:hover
{
-moz-box-shadow: 0px 0px 6px rgba(60, 60, 60, 0.8);
-webkit-box-shadow: 0px 0px 6px rgba(60, 60, 60, 0.8);
box-shadow: 0px 0px 6px rgba(60, 60, 60, 0.8);
}
Here is a fiddle example. I've made the shadow much bigger so you can see the effect more clearly: http://jsfiddle.net/DYdZs/