How can i change the SCSS variable's values in SCSS? - reactjs

$backgroundColor:red;
#deneme{
width:200px;
height: 200px;
background-color: $backgroundColor;
}
#media (max-width:1000px){
$backgroundColor:green;
#deneme{
width: 200px;
height: 200px;
background-color: $backgroundColor;
}
}
Hi, I have a code that changes SCSS variable's value and change the color of a div. It works correctly, but when I write it this way,
$backgroundColor:red;
#media (max-width:1000px){
$backgroundColor:green;
}
#deneme{
width: 200px;
height: 200px;
background-color: $backgroundColor;
}
it doesn't work and the color will be red for all the pixel values. I want to know why, because I want to use this method and change the variable's value, then import this value in other SCSS files. Could you please help me about how to make this happen? Thanks in advance.
I want to create a SCSS file in my Nextjs project and change the some variable's value according to px value of the screen and then I want to use this variables in different SCSS files. I need some help, thanks in advance.

Related

How can we expand the lightning component to full screen

I have the requirement to expand the lightning component on whole screen.
I tried the css but that's not worked. But None of them working
.maincontent{
height: 100%;
background-color: deepskyblue;
}
html, body { height: 100%; }
body { background-color: deepskyblue; }
Please suggest the way to achieve it.
Current Page:-
[![Current][1]][1]
Expectation :-
[![Expectation][2]][2]
[1]: https://i.stack.imgur.com/iuI6K.png
[2]: https://i.stack.imgur.com/qLZhs.png

Brand Image resizing/ Webflow

I’m trying to make my brand image larger at the top of the page, but Webflow is not allowing me. Anyone know how to fix this? Also does anyone know how to change the gradient colors in this template?
https://preview.webflow.com/preview/dan-the-baking-man-upgraded?utm_medium=preview_link&utm_source=designer&utm_content=dan-the-baking-man-upgraded&preview=d77107e0ddecb4c38fc4f9487940ab48&workflow=preview
To increase the size of your logo to say 100x100px, try
.brand-image {
height: 100px;
max-height: 100px;
width: 100px;
}
If this doesn't work, test if you need to add !important; to each of the properties.
For the colours, it looks to me that they are set in 2 places
body {
background-color: var(--swatch_879f80bc);
}
and
.background-primary-image{
background-image: url(https://uploads-ssl.webflow.com/6144c33b7975b17710abbbef/6144c33b7975b10e34abbc4e_Background%20Gradient.png);
}

Styled component not showing ::after pseudo class if content is an empty string

I am having problems findign a solution to this. In styled components I am using the after pseudo element. It works as long as I have the content value set to something, otherwise it doesen't show up. I need it to be empty (just as in plain CSS). What is the way to do it?
export default css`
display: flex;
height: 100%;
width: 100%;
&::after {
bottom: 0;
content: "";
position: absolute;
width: calc(100% - 11px);
box-shadow: 0 8px 6px 0px rgba(var(--rgb-black),0.16);
}´
You didn't set the height of ::after
I encountered this problem also, I couldn't get styled-components to render a :after pseudo element without using a non-empty content string. But making the text invisible was an acceptable workaround for me:
&::after {
content: "a"; //use non-empty string
color: rgba(0,0,0,0); //make it invisible
display: inline-block; //so width & height can be set
}
Here is the complete example on CodePen: https://codepen.io/remyho427/pen/VwMNeaG

how to change the antd carousel dot shape and color with styled component

tried to change the antd carousel dots styles, it can be able to implement with CSS but not with styled-components(CSS is not allowed in my project). as im new to front-end dont know the proper solution for this.
here is the code example https://stackblitz.com/edit/react-opnojd-rfagtz?file=index.js
thanks in advance :)
When using styled-component, the style would be applied with className sc-....
In your case, its style would be applied in div containing .slick-slider.
But, .ant-carousel is className for parent of that.
So, if it was included in the selector, style will be not applied.
Try this.
const CarouselWrapper = styled(Carousel)`
> .slick-dots li button {
width: 6px;
height: 6px;
border-radius: 100%;
}
> .slick-dots li.slick-active button {
width: 7px;
height: 7px;
border-radius: 100%;
background: red;
}
`;

Drupal 7: Put a loading screen before everything is loaded

My Drupal site takes a while to load, and while it's loading everything looks messed up. So I opted for a simple solution that it's using a loading screen with this kind of solution:
Display a loading bar before the entire page is loaded .
But I have no idea how to implement it in Drupal 7.
Can you please help me with some clues?
Thank you!
.ajax-progress-throbber {
z-index: 1500;
border: 2px solid #C0C0C0;
position: fixed;
background: url('loader.gif') no-repeat center #ccc !important;
opacity:0.6;
padding:20px;
border-radius:10px;
-webkit-border-radius:10px;
-moz-border-radius:10px;
width:100%;
min-width: 100%;
height:100%;
left:0;
top:0;
}
I have done like this by putting this code in my css file and used a loader.gif image which is laso in the same folder where my css file is and use that class . Basically i use loader image every time i trigger ajax. You can use it as you want with according to different class.

Resources