Skip to main content
Participant
Sep 20, 2022 5:45 PM UTC
Question

File issue

maybe I have no clue what i am doing but apparently styles.css  and styles.scss  cannot exist together in a folder. When I make the scss file - both files are then erased to blank.

Anyone can help me. Thanks in advance i would like to have an answer for my content writing

[Moderator Note: Irrelevant backlink removed.]
    This topic is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    Community Expert
    Sep 21, 2022 9:12 AM UTC

    @Ryan26209318c4si I use styles.scss all the time, and although I use a different tree structure (I don't put my SCSS and CSS files in the same folders), for testing purpose, I've never had a problem putting the two in the same folder.


    Try to create a new site, blank, just place a SCSS file into it and test... do both files always disappear?

    Translate
    Nancy OShea
    Community Expert
    Community Expert
    Sep 20, 2022 6:40 PM UTC

    SCSS and CSS are not the same things.  The former is pre-processed code used in SASS (synthetically awesome style sheets), the latter is final processed code recognized by browsers.

     

    Developers typically prefix their SCSS files with an underscore,  _styles.scss.  SCSS is convenient for advanced developers who combine it with variables and mixins prior to running it through a processor that exports it to final CSS, styles.css.

     

    Hope that helps.  Post back if you have more questions.

     

     

    Translate
    Nancy O'Shea— Product User & Community Expert
    Community Expert
    Sep 21, 2022 9:06 AM UTC
    quote

    Developers typically prefix their SCSS files with an underscore,  _styles.scss. 

    By @Nancy OShea

     

    In fact, this is not quite true. Prefixing a SCSS document with an underscore tells the compiler that this is a partial file, and that this file, which must be imported into another SCSS file, does not need to be rendered as a CSS file.

     

    https://sass-lang.com/guide#topic-4


    Therefore, prefixed files will not be rendered, so if you prefix the styles.css file, which is the filename usually used as a root file, this file will never be rendered as CSS.


    Generally, we use underscore as a prefix, only for files imported into another file.

     

    Translate