Some more ADVANCED SASS Properties...

Why Advanced UI?

  • Make it easy to navigate and allow users to access information and features easily
    • Modern applications today are complex and advanced and uses an array of features and functions
    • It is important to create an easy to understand so users can quickly navigate the interface
      • To better user satisfaction and retention
        • Users more likely to use an application if they are able to navigate it and meet their needs effectively
  • To make the interface available for a variety of devices (needs to be able to adjust to a variety of screen sizes)

Examples of SASS to create an animation effect

Here's an example of how you can use Sass to create an animation effect.

// This defines an animation called fade-in that starts with an opacity of 0 and gradually increases to an opacity of 1. Put this code in your SASS file.

@keyframes fade-in { 

  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

The @keyframes rule specifies the different states of the animation at different points in time. In this case, it has two states defined using the from and to keywords.

The from state specifies the initial state of the animation, in this case with an opacity of 0. The to state specifies the final state of the animation, with an opacity of 1.

When this animation is applied to an element in CSS, it will gradually transition from an opacity of 0 to 1 over a specified duration.

// Next, you can apply the animation to an element in your CSS using the animation property. You can specify the name of the keyframes, the duration of the animation, and other animation-related properties.

.my-element {
  animation-name: fade-in;
  animation-duration: 1s;
  animation-timing-function: ease;
  animation-delay: 0s;
  animation-iteration-count: 1;
  animation-direction: normal;
  animation-fill-mode: forwards;
}

Here is an example of creating a Grid Layout

// This defines a 3x3 grid 
$grid-template-columns: repeat(3, 1fr);
$grid-template-rows: repeat(3, 1fr);

// create a class for your grid container element in your Sass file and apply the grid properties using the Sass variables defined earlier. This creates a grid container with the display
.grid-container {
  display: grid;
  grid-template-columns: $grid-template-columns;
  grid-template-rows: $grid-template-rows;
  gap: 1rem; // Add gap between grid items
}

// positioning
.grid-item-1 {
  grid-column: 1 / span 1; // Place in column 1, span 1 column
  grid-row: 1 / span 1; // Place in row 1, span 1 row
}

.grid-item-2 {
  grid-column: 2 / span 1; // Place in column 2, span 1 column
  grid-row: 1 / span 3; // Place in row 1, span 3 rows
}

// ... define other grid item classes as needed
// In your html file, put this code now. 

<div class="grid-container">
  <div class="grid-item-1">Grid Item 1</div>
  <div class="grid-item-2">Grid Item 2</div>
</div>

Themes

What to know before changing themes:

Stylesheets: To change the visual appearance of an application, you need to modify the stylesheets that control the presentation of the UI elements. This may involve editing and creating styles to fit your application

Configuration files: Applications have configuration files that control the behavior and appearance of the application. You may need to modify these files in order to change the theme.

Why compile SASS to CSS

HTML is not able to read SASS, but it can read CSS. You are able to compile a SASS file using the VS Code extension called "Live Sass Compiler" to automatically convert your SASS file to CSS so that you can use it with HTML. It is better to keep your css and sass files in separate folders as you might encounter problems as we have when trying to access them.

Now we want you to install the VS Code extension mentioned above and convert your custom styles