Shopify Theme Development Certification Practice Exam

Access More Questions
Which code snippet correctly includes a Sass file named theme.scss in a Shopify theme?
Correct Answer:
{{ 'theme.scss.css' | asset_url | stylesheet_tag }}
Explanation:
The correct approach to include a Sass file, such as theme.scss, in a Shopify theme is through the use of Liquid filters to ensure the appropriate processing and loading of the asset. In this context, when a Sass file is compiled, it typically generates a corresponding CSS file that is served to the browser. Using the path and methodology defined in Shopify's asset management system, the proper way to include the compiled output of a Sass file in your theme is to reference the generated CSS file. In practice, theme.scss will be processed automatically by Shopify, resulting in a theme.css file in the assets folder. Therefore, referencing theme.scss.css directly would not access the right compiled file. Instead, utilizing asset_url in conjunction with stylesheet_tag is the correct method to link to the final CSS output that is generated from your Sass file. Consequently, the snippet that is built correctly for this purpose utilizes the asset_url filter that points to the generated stylesheet correctly in its final output.

Access more questions from this quiz

Continue to Shopify Theme Development Certification Practice Exam for more practice questions and the full quiz experience.

Access More Questions