如何在BC Stencil主题(Cornerstone Light)添加CSS/JS文件及解决文件夹缺失问题
Hey there! Let’s tackle your two BigCommerce theme questions one by one:
1. Adding Custom CSS/JS Files to Your BC Stencil Theme
Here’s a straightforward, reliable way to add your own styles and scripts:
- First, access your Stencil theme files (either locally via the Stencil CLI or remotely via SFTP). Locate the
assets/cssandassets/jsdirectories. Drop your custom CSS file (e.g.,custom-styles.css) into thecssfolder, and your custom JS file (e.g.,custom-scripts.js) into thejsfolder. - Next, open the
templates/layout/base.htmlfile—this is the core layout template that loads across your entire store.- For CSS: Find the
<head>section where other theme styles are linked. Add a new line using Stencil’s built-in asset helper to reference your file:<link rel="stylesheet" href="{{ asset_url('css/custom-styles.css') }}"> - For JS: Scroll to just before the closing
</body>tag (where most scripts are loaded for better performance) and add your script:<script src="{{ asset_url('js/custom-scripts.js') }}"></script>
- For CSS: Find the
- If working locally, run
stencil startto preview changes, thenstencil pushto deploy them to your live store. If using SFTP, upload the modifiedbase.htmland your new asset files to the server.
2. Fixing Missing Cornerstone Light Theme Folder in Cyberduck
Let’s troubleshoot this step by step:
- Double-check your SFTP credentials: Make sure you’re using the correct host, username, and password from your BigCommerce store’s Settings > Advanced > SFTP Access. Even a tiny typo can block access to the full directory structure.
- Navigate to the correct path: BigCommerce themes are stored in the
/content/themes/directory. After connecting via SFTP, drill down into this folder—yourcornerstone-lightdirectory should be listed here alongside other installed themes. - Refresh or reconnect: Cyberduck sometimes caches folder views. Press
Cmd+R(Mac) orCtrl+R(Windows) to refresh the current directory, or disconnect and reconnect your SFTP session to load the latest structure. - Verify theme deployment status: In your BigCommerce admin, go to Storefront > My Themes. Ensure the Cornerstone Light theme is either active or has been fully uploaded (draft themes might not appear in SFTP until they’re deployed to the server).
- Check user permissions: If you still can’t find the folder, your SFTP user might lack access to the theme directories. Reach out to BigCommerce support to confirm your account has full permissions for the
/content/themes/path.
内容的提问来源于stack exchange,提问作者Hitesh Sharma
相关产品推荐
相关产品推荐

