How can I use custom theme palettes in Angular?

After some research I ended up with this conclusion which solved it for me, hope it will help you too. Step1: Create your own palettes from branding colors. Found this awesome website where you enter your brand color, and it creates a complete palette with the different shades of that brand color: http://mcg.mbitson.com I used … Read more

Sass calculate percent minus px

Sass cannot perform arithmetic on values that cannot be converted from one unit to the next. Sass has no way of knowing exactly how wide “100%” is in terms of pixels or any other unit. That’s something only the browser knows. You need to use calc() instead. Check browser compatibility on Can I use… .foo … Read more

Change text color based on brightness of the covered background area?

Interesting resources for this: W3C – Ensure that foreground and background color combinations provide sufficient contrast Calculating the Perceived Brightness of a Color Here’s the W3C algorithm (with JSFiddle demo too): const rgb = [255, 0, 0]; // Randomly change to showcase updates setInterval(setContrast, 1000); function setContrast() { // Randomly update colours rgb[0] = Math.round(Math.random() … Read more

Using Sass Variables with CSS3 Media Queries

This is simply not possible. Since the trigger @media screen and (max-width: 1170px) happens on the client-side. Achieving your expected result would only be possible if SASS grabbed all rules and properties in your stylesheet containing your $base_width variable and copied/changed them accordingly. Since it won’t work automatically you could do it by hand like … Read more

What are Compass and Sass and how do they differ?

From Sass and Compass in Action, by Wynn Netherland, Nathan Weizenbaum, Chris Eppstein, and Brandon Mathis: 1.3 What is Compass? Compass helps Sass authors write smarter stylesheets and empowers a community of designers and developers to create and share powerful frameworks. Put simply, Compass is a Sass framework, designed to make the work of styling … Read more

Vue CLI CSS pre-processor option: dart-sass VS node-sass?

Update 09/17/2020: As this answer gets up-votes every day, I thought maybe it is worth diving deeper into this topic. Considering sass-lang website: Dart Sass is the primary implementation of Sass, which means it gets new features before any other implementation. It’s fast, easy to install, and it compiles to pure JavaScript which makes it … Read more

Angular-cli from css to scss

For Angular 6 check the Official documentation Note: For @angular/cli versions older than 6.0.0-beta.6 use ng set in place of ng config. For existing projects In an existing angular-cli project that was set up with the default css styles you will need to do a few things: Change the default style extension to scss Manually … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)