Nested SCSS Conversion Request
February 19, 2025 Β· AI Conversations
border-top: 1px solid #2A5AA1;
}
@media (min-width:767px){
.service-content-mobile{
display:none;
}
.service-content-desktop{
display: grid
;
grid-template-columns: repeat(3, 1fr);
gap: 64px 56px;
}
.service-item h5 {
font-size: 24px;
font-weight: 500;
line-height: 1.1;
margin-bottom: 8px !important;
}
.service-item {
padding:16px;
padding-top: 20px;
}
}
@media (max-width:767px){
.service-content-desktop{
display:none;
}
.service-item {
padding-top:16px !important;
}
}
make above nested scss
.service-item {
border-top: 1px solid #2A5AA1;
@media (min-width: 767px) {
padding: 16px;
padding-top: 20px;
h5 {
font-size: 24px;
font-weight: 500;
line-height: 1.1;
margin-bottom: 8px !important;
}
}
@media (max-width: 767px) {
padding-top: 16px !important;
}
}
.service-content-mobile {
@media (min-width: 767px) {
display: none;
}
}
.service-content-desktop {
@media (max-width: 767px) {
display: none;
}
@media (min-width: 767px) {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 64px 56px;
}
}
This maintains the same styling but is structured using SCSS nesting for better readability and maintainability. π
fill: #2A5AA1 !important;
}
.icon-box:hover h3{
color: #2A5AA1 !important;
}
.icon-box {
&:hover {
svg {
path {
fill: #2A5AA1 !important;
}
}
h3 {
color: #2A5AA1 !important;
}
}
}
This keeps your styles organized and easier to manage using SCSS nesting. π
overflow: hidden;
}
.blue-banner::before {
content: "";
position: absolute;
top: 0;
transform: translateX(23%);
height: 100%;
background-image: url('~@images/Lange.png');
background-repeat: no-repeat;
background-size: contain;
background-position: center;
transition: transform 1.2s ease-out;
}
.blue-banner.scrolled {
opacity: 1;
transform: translateY(0);
}
.blue-banner.scrolled::before {
transform: translateX(12%);
}
.blue-banner {
overflow: hidden;
position: relative; // Ensure positioning context for the ::before pseudo-element
&::before {
content: "";
position: absolute;
top: 0;
transform: translateX(23%);
height: 100%;
background-image: url('~@images/Lange.png');
background-repeat: no-repeat;
background-size: contain;
background-position: center;
transition: transform 1.2s ease-out;
}
&.scrolled {
opacity: 1;
transform: translateY(0);
&::before {
transform: translateX(12%);
}
}
}
This SCSS version keeps the styles nested and maintains clarity while ensuring proper scoping. π
transition: transform 0.3s ease;
transform-origin: center;
width: 100%;
height: 100%;
object-fit: cover;
}
.grid-img-animation img:hover {
transform: scale(1.1);
}
.grid-img-animation .elementor-widget-image{
overflow: hidden;
}
@media (min-width:1366px){
.block-width{
max-width: min(100%, 720px);
margin-left: auto;
}
}
.grid-img-animation {
img {
transition: transform 0.3s ease;
transform-origin: center;
width: 100%;
height: 100%;
object-fit: cover;
&:hover {
transform: scale(1.1);
}
}
.elementor-widget-image {
overflow: hidden;
}
}
@media (min-width: 1366px) {
.block-width {
max-width: min(100%, 720px);
margin-left: auto;
}
}
This SCSS structure improves readability and maintainability while keeping your styles organized. π