Sass Alert: The mixin called roboto-family is missing from the stylesheet. Trace: Problem detected in src/pages/forms/forms.scss at

Greetings, I am diving into the world of Ionic for the first time. Recently, I embarked on a new project in Ionic and decided to integrate a theme. To do so, I copied an .html file, an .scss file, and also created a .ts file.

Forms.html

<!DOCTYPE html>
<html>
   <head lang="en">
     <meta charset="UTF-8">
     <title>Title</title>
     <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
     <link rel="stylesheet" type="text/css" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
     <link rel="stylesheet" type="text/css" href="../bower_components/ionic/release/css/ionic.min.css">
     <link rel="stylesheet" type="text/css" href="../dist/css/ionic.material-design-lite.css">
     <script src="../bower_components/ionic/release/js/ionic.bundle.js"></script>
     <script src="../dist/js/ionic.material-design-lite.bundle.js"></script>
     <script src="js/app.js"></script>
  </head>
  <body class="use-material-icons" ng-app="material-starter">
       <div class="bar bar-header bar-assertive">
           <button class="button icon ion-navicon"></button>
           <h1 class="title">Form Elements</h1>
       </div>
       <ion-content class="has-header padding">
           <div class="list">
               <label class="item item-input">
                     <input type="text" placeholder="First Name" class="ng-invalid">
               </label>
               <label class="item item-input item-floating-label input-calm">
                    <span class="input-label">Last Name</span>
                    <input type="text" placeholder="Last Name">
              </label>
              <label class="item item-input input-energized">
                    <span class="input-label">Username</span>
                    <input type="text" ng-model="user">
              </label>
             <label class="item item-input item-stacked-label">
                    <span class="input-label">Email</span>
                    <input type="text">
             </label>
             <label class="item item-input">
                   <textarea placeholder="Comments"></textarea>
             </label>
         </div>

        <div class="list list-inset">
             <label class="item item-input">
                  <input type="text" placeholder="Username">
             </label>
             <label class="item item-input">
                  <input type="password" placeholder="Password">
             </label>
       </div>

       <div class="list">

           <div class="item item-input-inset">
               <label class="item-input-wrapper">
                    <input type="text" placeholder="Email">
               </label>
               <button class="button button-small">
                Submit
               </button>
           </div>
      </div>

      <div class="padding">
          <button class="button button-block button-positive">Submit</button>
       </div>
     </ion-content>
  </body>
</html>

Forms.scss

The styles within the Forms.scss file have been tailored to provide a unique design experience.

Forms.ts

Introducing the functionality written in TypeScript for the FormsPage component. It allows for interaction with the form elements.

Upon running the command 'ionic serve', an error was encountered:

Sass Error

A mixin named roboto-family is missing Backtrace: src/pages/forms/forms.scss:5

The fonts have been stored at the following path:

src/www/assets/fonts/roboto

If anyone could offer assistance in resolving this issue and point out any overlooked details, it would be greatly appreciated.

Answer №1

It seems that the code contains a repeated line:

@include roboto-family('Regular', 400);

However, no specific value or mixin for the roboto-family inclusion has been defined.

Let me illustrate this with an example.

A mixin enables you to create sets of CSS declarations that can be reused across your website. You can also input values to make your mixin more adaptable. An ideal use case for a mixin would be for vendor prefixes. Here is an instance for border-radius.

    @mixin border-radius($radius) {
      -webkit-border-radius: $radius;
         -moz-border-radius: $radius;
          -ms-border-radius: $radius;
              border-radius: $radius;
        }

.box { @include border-radius(10px); }

To form a mixin, employ the @mixin directive followed by a name. In this scenario, we have named our mixin as border-radius. Additionally, the variable $radius inside the parentheses allows us to insert any desired radius value. Subsequently, once the mixin is created, it can be utilized as a CSS declaration beginning with @include and stating the name of the mixin. When the CSS is generated, it will appear like this:

.box {
  -webkit-border-radius: 10px;
  -moz-border-radius: 10px;
  -ms-border-radius: 10px;
  border-radius: 10px;
}

In order to utilize @include roboto-family, you must define an @mixin roboto-family

I hope this explanation resolves your query.

ref: For more information and a detailed explanation

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible for me to use an image as a grid item?

I have a grid with 3 elements as shown below: Now, I am looking to replace the blue elements with images (they can be just placeholders). .grid-container { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(30em, auto); justi ...

It seems that Firefox is ignoring the word-wrap style when the class of a child element is changed

Take a look at this: var iconIndex = 0; var icons = ['check', 'chain-broken', 'flag-o', 'ban', 'bell-o']; $('button:eq(0)').click(function() { iconIndex = (iconIndex + 1) % icons ...

Updating the useState() function in React when the value changes can be done by utilizing the

I'm struggling to update the count value in my React project. Within my dynamic set, I aim to display the size of the set whenever it changes! My goal is to continuously update the count variable to match ratedSet.size whenever the set's size c ...

How can a div tag and its class be nested using CSS in Angular?

Can someone help me with nesting a div tag with the "error" class in CSS? <div [class]="{error: condition}">{{ message }}</div> I want to know how to have the .error selector inside the div selector in the CSS file. Note: The error ...

Align elements on the left side with some space between them

Having trouble displaying a list of images inline within a div. When I float them left, they leave a lot of space and do not display properly. Can anyone help me with this issue? See screenshot below: Here is my html code: <div class="col75"> & ...

Simple steps for Mocking an API call (Get Todos) using ComponentDidMount in React with Typescript, Jest, and Enzyme

About the application This application serves as a basic To Do List. It retrieves tasks from an API located at https://jsonplaceholder.typicode.com/todos?&_limit=5. Objective of the project The main goal is to test an API call that triggers ...

The font rendering in Safari appears to have distinct differences compared to other web browsers

My concern is related to the HTML tag below: <a href="/partner-team/team" class="button button__style--1">MEHR</a> This is how the CSS appears: a { text-decoration: none; } .button { padding: 0.2rem 4rem; curso ...

Modify the color or background color of a disabled Material UI checkbox

The disabled unchecked checkbox appears too subtle to me, and I would like to enhance it by giving it a grey background and changing the cursor style to not-allowed. I've been trying to implement these styles on the checkbox using the makeStyles, but ...

Creating a date format for a REST API using Typegoose and Mongoose

Currently, I am utilizing TypeScript for a server that is connected to a MongoDB database. To ensure consistency, I am defining the outputs using an OpenAPI file. When working with Mongoose, I have experience in defining dates like this: birthday: Dat ...

Showing identification and name within a URL path - Angular

I am looking to update a URL path within a website from http://localhost:4200/viewbrand/1 to http://localhost:4200/viewbrand/1/soap, where "soap" is added after the ID in the path. The current code in the routing module.ts file is as follows: { path: &apo ...

Adjusting SVG size based on the position of the cursor for transforming origin

My goal is to scale an SVG circle using the trackpad (by moving two fingers up and down), with the origin of the transform being the cursor position. Initially, the scaling works as intended, but on subsequent attempts, the circle changes position, which s ...

Angular animation not firing on exit

I am encountering an issue with my tooltip component's animations. The ":enter" animation is working as expected, but the ":leave" animation never seems to trigger. For reference, here is a link to stackblitz: https://stackblitz.com/edit/building-too ...

Exploring the world of ng2-translate for translating texts

For the translation of headings and texts in my Angular2 web application, I utilized ng2-translate. However, I am facing a dilemma when it comes to translating texts that are passed from a .ts file. For example, I can easily translate texts in an HTML fi ...

Can you explain the mechanics behind the animation of the upvote button on steemit.com?

Behold the upvote button of steemit.com: <span class="Icon chevron-up-circle" style="display: inline-block; width: 1.12rem; height: 1.12rem;"> <svg enable-background="new 0 0 33 33" version="1.1" viewBox="0 0 33 33" xml:space="preserve" xmlns=" ...

Karma Jasmin is puzzled as to why her tests are failing intermittently, despite the absence of any actual test cases

In this snippet, you will find my oninit method which I am instructed not to modify. ngOnInit(): void { this.setCustomizedValues(); this.sub = PubSub.subscribe('highlightEntity', (subId, entityIdentifier: string) => { ...

Tips for positioning a div element at the center in ASP.NET

I have written the following code snippet: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Main.aspx.cs" Inherits="Main" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transit ...

How to conditionally import various modules in Next.js based on the environment

Having two modules 'web,ts' and 'node.ts' that share similar interfaces can be challenging. The former is designed to operate on the client side and edge environment, while the latter depends on node:crypto. To simplify this setup, I a ...

Is there a point in bundling NPM packages if they are ultimately going to be bundled by the project

I'm in the process of creating a TypeScript package for publication on NPM. My plan is to utilize this package in upcoming web development endeavors, most likely utilizing Vite. As I look ahead to constructing a future website with this module, I am c ...

What is the best way to make my button sticky across different screen sizes on my webpage?

I'm having trouble figuring out how to make my purple button sticky and responsive on the right side of the screen as I scroll down. Can someone help me with this? This is the snippet of my HTML code: <Col className="colPre"> ...

first item's grandchild selection

https://jsfiddle.net/jg69c3yf/1/ I don't have a lot of experience with CSS. My goal is to target the div with the class arrow-right, but only if it's inside the first child of a div with the class active. In this sample code, Only item 3 shoul ...