logo
down
shadow

How can I repeat the same CSS elements? (scss)


How can I repeat the same CSS elements? (scss)

By : Ashish07
Date : November 20 2020, 04:01 AM
seems to work fine I figure that you don't have to create new wrapper, just create more .circle would be fine.
HTML:
code :
<div>
  <div class="wrapper">
    <div class="circle-container">
      <div class="circle" v-for="i in 120"></div>
    </div>
  </div>
</div>
 .wrapper {
   display: flex;
   width: 100%;
   height: 500px
 }

 .circle-container {
   margin: 8%;
   position: relative;
   width: 100%;
   height: 100%;
 }

 .circle {
   position: absolute;
   top: 50%;
   left: 46%;
   width: 60px;
   height: 60px;
   border-radius: 40%;
   opacity: 0.7;
   background: #ffe63d;

   &:nth-child(5n+1) {
     background: orange;
   }
 }

 @for $i from 1 through 120 {
   .circle:nth-child(#{$i}) {
     @if $i>90 {
       transform: rotate($i*12deg) translateX(480%);
     }
     @elseif $i>60 {
       transform: rotate($i*12deg) translateX(390%) scale(0.8);
     }
     @elseif $i>30 {
       transform: rotate($i*12deg) translateX(315%) scale(0.7);
     }
     @else {
       transform: rotate($i*12deg) translateX(252%) scale(0.55);
     }
   }
 }


Share : facebook icon twitter icon
scss nesting , repeat necessary

scss nesting , repeat necessary


By : Cody
Date : March 29 2020, 07:55 AM
wish help you to fix your issue It makes no sense to inherit all properties of parents selectors, but for cases where it is desirable that we have the @extend directive:
SASS
code :
.top {
  position: fixed;
  top: 2%;
  &__left {
    @extend .top ;
    left: 1%;
  }
  &__right {
    @extend .top;
    right:1%;
  }
  &__centered {
    position: fixed;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
.top, .top__left, .top__right {
  position: fixed;
  top: 2%;
}
.top__left {
  left: 1%;
}
.top__right {
  right: 1%;
}
.top__centered {
  position: fixed;
  left: 50%;
  transform: translate(-50%, -50%);
}
SCSS: How to not repeat declaration in CSS file?

SCSS: How to not repeat declaration in CSS file?


By : Odran
Date : March 29 2020, 07:55 AM
around this issue Given an element with a .progress class descended from an element with either of these id's, the following pattern should work:
code :
.parent {
    .child {}
}
#basicMob,
#notBasicMob {
     .progress {
         background: green none repeat scroll 0 0;
}
.some-class {
   &.another-class {}
}
Why is the scss repeat function not working?

Why is the scss repeat function not working?


By : user2396380
Date : March 29 2020, 07:55 AM
around this issue I want to do this in scss border-color: rgb(170, 170, 170) repeat(3,black) ; , here's a SASS function that does the job.
code :
@function repeater($n, $character) {
    $c: "";

    @for $i from 1 through $n {
        $c: $c +" "+ $character;
    }

    @return unquote($c);
}

// now i can use it :D
border-color: rgb(170, 170, 170) repeater(3, black);
SCSS repeat value?

SCSS repeat value?


By : Heiko Zhang
Date : March 29 2020, 07:55 AM
this will help I'm trying to work out on SCSS how I would go about something like this: , Well you need a @for loop to do that .
SCSS :
Nesting up scss with main.scss and subcomponent scss files

Nesting up scss with main.scss and subcomponent scss files


By : Wadda Phuc
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further you need to extend you second class with the first import work ith cascading so you can do this :
main scss
code :
 .small-size-text{
    font-size: 12px;
    }
@import 'main.scss';

.title-content{
    @extend .small-size-text;
    color: red;
}
Related Posts Related Posts :
  • CSS: 2 divs, side by side, right div gets cut off on resize
  • Cannot change the input background color when using jQueryUI datepicker
  • Level of hierarchy on CSS in a legacy application in Ruby
  • Set Bootstrap container class to 940px max
  • Content inside of flexbox container not displaying links inline
  • Removing underlining from certain elements inside a <u>
  • CSS Specificity in Angular Component using /deep/ when a class is outside the component
  • How to display background color in CSS not working?
  • What is -ms-value
  • Class "Container" bootstrap not working with direction
  • What exactly happens when a browser doesn't support feature queries?
  • Div with image inside css class not showing in IE or Edge
  • How to change background color of active tab in Bootstrap without affecting other active classes
  • How would I automatically adjust the width of the dropdown content to match the width of the <p> element?
  • How to build this responsive grid with css grid
  • CodePen: How to swap these blocks in this specific order, in responsive?
  • CSS correct li order for multiple column layout
  • how to make footer not stretches to the full window size
  • Can bootstrap mix with defined CSS?
  • CSS grid equal size columns
  • mat-prefix to work on the input not the label
  • change color of ion range-slider handle
  • Numpy: sort Matrix's elements by index
  • Position two last flex items at the end oft the container
  • Center columns for the exact size(ex. tablet) in Bulma
  • Transform CSS clip-path with mixed (fixed and percentage) values to SVG clip-path
  • Use svg pattern in css
  • How to make smooth zooming effect in html?
  • How can I avoid repeating elements that only change one thing in CSS?
  • how to change the size of a fixed header
  • How to make point unit align in css?
  • How can I add text-decoration to my Angular Material mat-form-field?
  • Can't get codepon accordion css-only code to work
  • CSS nav background colour change only when scrolled to first section tag
  • Have element appear in same location as another during CSS animation
  • serve_site changes CSS to its default values in blogdown
  • Please help align by button with CSS
  • Use of Bootstrap Container
  • Vertical alignment in a position-fixed div
  • bootstrap responsive images with shadow+text overlays and another overlay when hover
  • Div multiple borders for paper simulation
  • Change Location Grid
  • Div Previous Siblings is not reducing it's size
  • How do you center a text-align=left text in a table cell in angular (css table)?
  • CSS: how to align images vertically bottom
  • What things we should avoid in small screen, low bandwidth supported devices compare to big screen , high bandwidth supp
  • Float problem in IE, second floated div causes a 'clear'?
  • Using ClientBundle image resources in css urls
  • set image size with respect to the screen resolution
  • HELP Please - CSS Width Problems on IE8
  • How can I clean this CSS code; making it shorter or delete unnecessary parts (CSS perfectionist needed)
  • css not work without DOCTYPE !
  • Setting a background image in a div, position options
  • a bug in IE7 - body -direction:rtl
  • Which is the CSS hack you use most often and which one do you avoid using?
  • In CSS when should you use ids and when should you use classes?
  • Combining CSS Pseudo-elements, ":after" the ":last-child"
  • IE is ignoring Z-Index on positioned elements
  • Inline Unordered List
  • CSS display: inline; float: left, but div blocks don't stay one close to the other
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org