Posts

Showing posts with the label Sass

Can I Convert Css To Scss And Scss To Css Parallelly?

Answer : It is possible , but not ideal. Your best bet is to crack open your terminal and run sass-convert --from css --to scss in the directory where your styles are located and then refactor from there . It's a pain, and not a true "conversion". It tries to nest properly, and usually gets it right, but if you're not refactoring the code and using things like mix-ins, extends, and variables, it kind of defeats the purpose of using SASS to begin with. To automate this, you may want to use something like Guard to watch the css files for changes. You'll want to make sure you're not also watching your main style (the one that sass is compiling to), as this will put you in a never-ending loop of conversion! Use a command for installing compass gem install compass Run this command. This will scan defined directory for css files and convert them to scss files. sass-convert -R my_css_dir --from css --to scss Then execute this command compass watch...

Can I Calculate And Use Element Height With SASS \ Compass

Answer : You seem to have got the XY problem. You have a task to solve, and instead of asking us about the task, you ask about a solution that you tried and already found inappropriate. Why do you want to apply the top property equal to half of element's height and negated? Because you want to move an absolutely positioned element half its height up . This is the original task. There's a simple solution to achieve that, and SASS is not even necessary! (Actually, as long as you don't know element's height, SASS can't provide more help than CSS.) We'll need an extra wrapper: <div class=container> <div class=elements-wrapper> <div class=element> </div> </div> </div> To push the element up for 50% of its height, do two simple steps: 1) Push its wrapper up fully out of the container: .elements-wrapper { position: absolute; bottom: 100%; } 2) Now pull the element down for 50% of its height: .ele...

Change Ion-item Background Color In Ionic 4.0

Answer : Use this special ionic CSS rule: ion-item{ --ion-background-color:#fff; } I found the working one in ionic 4. Apply the below 2 css in your .scss file where you have implemented ion-list and ion-item: ion-item { --ion-background-color: white !important; } .item, .list, .item-content, .item-complex { --ion-background-color: transparent !important; } I seem to have found a fix. You just need to add color="light" to the ion-item element. Please see below: <ion-item class="light-back" color="light"> <ion-icon name="search" color="light"></ion-icon> <ion-input required type="text" placeholder="Search for a site" color="light"> </ion-input> </ion-item> The problem is that other code gets injected based on my theme, which I set to my primary color from my variables, so I need to indicate that I am again usin...