CSSS not generating proper mappings/compiling

After finally finding some time to delve into web design, I encountered a frustrating issue with my SCSS code failing to compile. Ugh.

The first red flag was when my changes weren't appearing in the live preview on Brackets. Upon inspecting the corresponding .css file, it became apparent that my alterations were no longer being reflected. Double ugh.

I attempted to troubleshoot by restarting everything - Brackets, Chrome, even my whole computer - but to no avail. In a last-ditch effort, I copied my .scss code to the clipboard, deleted all related files (home.scss, home.css, and home.css.map), and started anew by creating a fresh home.scss file. The mapper and .css files were successfully generated, indicating they were still functional. However, pasting my code back in yielded no results once again. I'm stumped. Has anyone else run into this issue before? Just yesterday, everything was working perfectly fine.

If it helps, here's the code snippet:

home.html

<!doctype html>
<html>

<head>

    <meta charset="UTF-8">
    <title>Home</title>
    <link href="https://fonts.googleapis.com/css?family=Oswald:200,300,400,700" rel="stylesheet">
    <link rel=stylesheet type="text/css" href="../css/home.css">

</head>

<body>

    <div class="first">
        <img src="../images/HN_LogoWhite.svg" />
    </div>
    <div class="second">
        <section>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur voluptatibus sed iusto quaerat nesciunt eius incidunt saepe quam, unde quisquam nobis maiores similique at illo soluta, iure ipsum! Minima, possimus?</section>
        <section>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Commodi, placeat ducimus quisquam, ullam quae temporibus esse fugiat nostrum quaerat eos facilis, excepturi labore laboriosam molestiae. Error libero ea saepe officiis.</section>
    </div>

</body>

</html>

home.scss

@import 'fontsAndColors';

/* Setting frame */

* {
    box-sizing: border-box;
}

html {
    font-family: $main_font;
}

body {
    background-color: $hn_white;
    margin: 0;
}

.first {
    background-image: url('../images/TopUnderwater.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;

    display: block;
    margin: auto;
    width: 100vw;
    height: 100vh;
    img {
        width: 20%;
        position: absolute;
        display: block;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: auto;
    }
}



.second {
    height: 100vh;
    text-align: center;
    background-color: $hn_green;
    padding: 5%;
    section {
        top: 10%;
        width: 30%;
        margin: 10%;
        padding: 10%;
        float: left;
        display: block;
        border: solid 1em $hn_green;
        position: relative;

        overflow:hidden;
    }
}

_fontsAndColors.scss

$hn_green: #6ca66b;
$hn_blue: #3398cc;
$hn_white: #ffffff;
$main_font: font-family: 'Oswald', sans-serif;

@mixin hn_bg_gr1($col1, $col2) {
    background: $col1;
    background: -webkit-linear-gradient(left top, $col1, $col2); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient(bottom right, $col1, $col2); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(bottom right, $col1, $col2); /* For Firefox 3.6 to 15 */
    background: linear-gradient(to bottom right, $col1, $col2); /* Standard syntax (must be last) */
}

@mixin hn_bg_gr2($col1, $col2) {
    background: $col1; /* For browsers that do not support gradients */
    background: -webkit-linear-gradient($col1, $col2); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient($col1, $col2); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient($col1, $col2); /* For Firefox 3.6 to 15 */
    background: linear-gradient($col1, $col2); /* Standard syntax */

}

Additionally, there's an unusual presence of home.css.map

{
  "version": 3,
  "file": "home.css",
  "sources": [
    "home.scss",
    "_fontsAndColors.scss"
  ],
  "mappings": "",
  "names": []
}

This may be unrelated, but things started going awry shortly after incorporating the Oswald font from Google Fonts.

Any insights would be greatly appreciated!

Answer №1

Everything seems to be fine now, but it turns out I made a silly error by typing this line in the _fontsAndColors-file: $main_font: font-family: 'Oswald', sans-serif;

This resulted in a syntax error. font-family: font-family: ...

Big thanks to jseezo for pointing that out!

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

Problem encountered in Vue.js web application when running NPM, resulting in Error 126

When attempting to compile my Vue.js application using the command npm run prod, I encountered the following error: sh: /Users/antoinevandenheste/Downloads/magicfactory-1/node_modules/.bin/webpack: Permission denied npm ERR! code ELIFECYCLE npm ERR! errno ...

Special html effects for scrolling

Recently, I've been noticing a trend of websites incorporating new and innovative scrolling effects. One great example is: As you scroll down the page, the initial section stays fixed in place (z-index of 1?) while the content scrolls over it seamles ...

Ways to display a box following the submission of a value within a form

There's a pop-up window where the user has to enter their name. After clicking the submit button, this window closes. You can try it out here: (Click the 21 button, enter any value, and see what happens) The function used for the pop-up box is: fu ...

Encountering issues with calling a custom directive within another custom directive in AngularJS

I need to implement a custom directive within the template of another custom directive. Here are the code snippets for reference: Issue with Scenario 1 angular.module('myApp') .directive('customOnChange', function () { return { r ...

Click on a button to send the React Router path as a parameter in

I've got a React form with a submission button like this: <Link className="btn btn-secondary btn-width-200 search-submit" to={{pathname: '/booking/search', query: this.state.filters}}> Search </Link> Within the ...

In CSS, there are two dynamic fields with adjustable widths, each occupying half of the total length

I have a collection of email addresses and names displayed in rows. My goal is to maximize the amount of content shown. For short names, more of the email address should be visible, while for shorter email addresses, more of the name should be shown. If bo ...

Python: inserting loop output into an HTML element using the embed function

My Python function generates a list that looks like this: def get_items(argument): for item in items: print item When I pass an argument to the function and print it on the terminal with "get_items(test)", I get: item1 item2 item3 Now, ...

Creating captivating website effects: Techniques for fading in divs using CSS3, HTML5, and Javascript

Currently facing a puzzling challenge that has me scratching my head. I'm trying to figure out how to achieve a fade-in effect for dynamically generated divs. These divs are created through Javascript, and I need them to smoothly fade onto the page. I ...

Tips for creating a fixed element with ScrollTrigger and GSAP

How can I prevent the right div from jumping on top of the left div when using a scroll trigger to make the left div's position fixed? gsap.registerPlugin(ScrollTrigger); const tlfour = gsap.timeline({ scrollTrigger: { trigger: ".ma ...

jQuery divs seem to "gaze up" towards the mouse pointer

I am attempting to recreate a fascinating effect using jQuery - where "cards" move in response to the mouse cursor as if they are looking up at it. I have come across a script that almost achieves what I need, but I require the ability to control the mov ...

Checking if the current time falls within a specific time range, without taking the year into account, using Javascript

I am looking to add a special feature using JavaScript. I would like to change the background images of my webpage to ones related to Christmas during the holiday week, and have it repeat every year. How can I determine if the current date and time fall ...

Issue with Modal Box: Datepicker not Displaying Correctly

I have implemented a modal box in my webpage. When I click on a text field where a datepicker is added, it does not display anything. However, when inspecting the element using Chrome's developer tools, I can see that the 'hasDatepicker' cla ...

Issue with Firefox causing Bootstrap form to appear incorrectly

I recently created a customized form using Bootstrap, but unfortunately, I'm encountering an issue with Firefox. Despite functioning perfectly on other browsers, the radio buttons are being pushed off the edge of the page and aren't displaying pr ...

Performing arithmetic calculations using HTML

Can math operations be done directly within an HTML element, such as <div width="50/2">, or is it necessary to use Javascript or CSS for this functionality? ...

Continue moving the division to the left

Below is the HTML structure that I am working with: <div class="container"> <div class="menu"></div> </div> Accompanied by jQuery: $(document).ready(function() { $(".container").click(function() { $(".menu").css("l ...

What is the best way to align text above a wrapper box?

After watching a tutorial on YouTube about creating a simple login form, I decided to customize it with some personal touches. I wanted to include a "Welcome" text above the login form, but when using h1, the text appeared next to the box rather than abov ...

Tips on achieving consistent division through CSS where both columns and rows have equal spacing

In my website's code, I am trying to display two blogs per row. While the width is divided correctly, there is an issue with the height. This is because some blogs have large titles and others have small titles, resulting in uneven content layout. In ...

js include exclude switch a category

Although this question has been asked before, I have a query on completely removing an "id" from an element. Let's consider the following scenario: <div id="page"> some content here </div> I want to eliminate the "id" attribute from the ...

Accessing the Bootstrap tab form from an external source

I currently have Bootstrap tabs on a page and they are functioning correctly. However, I am looking to open these tabs from an external page. Is this feasible? <div role="tabpanel"> <ul class="nav nav-tabs" role="tablist"> ...

Assist me in temporarily altering the color of menu items in a sequential manner upon the page's loading

Currently, I'm working on a website that features a subtle dark grey menu at the top of every page. The menu is built using HTML and CSS with a list structure. To highlight the corresponding menu item based on the current page, I am utilizing the ID a ...