Discover Shopify App Store – A Comprehensive Handbook 2024
Explore the Shopify App Store for tailored solutions to grow your business. Discover your perfect app today!
Cookies help us enhance your experience on our site by storing information about your preferences and interactions. You can customize your cookie settings by choosing which cookies to allow. Please note that disabling certain cookies might impact the functionality and features of our services, such as personalized content and suggestions. Cookie Policy
Cookie PolicyThese cookies are strictly necessary for the site to work and may not be disabled.
InformationThese cookies are strictly necessary for the site to work and may not be disabled.
Cookie name | Description | Lifetime | Provider |
---|---|---|---|
_ce.clock_data | Store the difference in time from the server's time and the current browser. | 1 day | Crazy Egg |
_ce.clock_event | Prevent repeated requests to the Clock API. | 1 day | Crazy Egg |
_ce.irv | Store isReturning value during the session | Session | Crazy Egg |
_ce.s | Track a recording visitor session unique ID, tracking host and start time | 1 year | Crazy Egg |
_hjSessionUser_2909345 | Store a unique user identifier to track user sessions and interactions for analytics purposes. | 1 year | HotJar |
_hjSession_2909345 | Store session data to identify and analyze individual user sessions. | 1 day | HotJar |
apt.uid | Store a unique user identifier for tracking and personalization. | 1 year | Mageplaza |
cebs | Store user preferences and settings. | Session | Mageplaza |
cf_clearance | Store a token that indicates a user has passed a Cloudflare security challenge. | 1 year | Cloudflare |
crisp-client | The crisp-client/session cookie is used to identify and maintain a user session within the Crisp platform. It allows the live chat system to recognize returning users, maintain chat history, and ensure continuity in customer service interactions. | Session | Crisp |
_ga | Store a unique client identifier (Client ID) for tracking user interactions on the | 2 years | |
_ga_7B0PZZW26Z | Store session state information for Google Analytics 4. | 2 years | |
_ga_JTRV42NV3L | Store session state information for Google Analytics 4. | 2 years | |
_ga_R3HWQ50MM4 | Store a unique client identifier (Client ID) for tracking user interactions on the website. | 2 years | |
_gid | Store a unique client identifier (Client ID) for tracking user interactions on the website. | 1 day | |
_gat_UA-76130628-1 | Throttle the request rate to Google Analytics servers. | 1 day |
Advertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.
InformationAdvertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.
Cookie name | Description | Lifetime | Provider |
---|---|---|---|
_gcl_au | The cookie is used by Google to track and store conversions. | 1 day | |
__Secure-3PAPISID | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 2 years | |
HSID | This security cookie is used by Google to confirm visitor authenticity, prevent fraudulent use of login data and protect visitor data from unauthorized access. | 2 years | |
__Secure-1PSID | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 2 years | |
SID | This security cookie is used by Google to confirm visitor authenticity, prevent fraudulent use of login data and protect visitor data from unauthorized access. | 2 years | |
APISID | This cookie is used by Google to display personalized advertisements on Google sites, based on recent searches and previous interactions. | 2 years | |
__Secure-1PAPISID | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 2 years | |
__Secure-3PSID | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 2 years | |
SSID | This cookie is used by Google to display personalized advertisements on Google sites, based on recent searches and previous interactions. | 2 years | |
SAPISID | This cookie is used by Google to display personalized advertisements on Google sites, based on recent searches and previous interactions. | 2 years | |
__Secure-3PSIDTS | This cookie collects information about visitor's interactions with Google services and ads. It is used to measure advertising effectiveness and deliver personalised content based on interests. The cookie contains a unique identifier. | 2 years | |
__Secure-1PSIDTS | This cookie collects information about visitor's interactions with Google services and ads. It is used to measure advertising effectiveness and deliver personalised content based on interests. The cookie contains a unique identifier. | 2 years | |
SIDCC | This security cookie is used by Google to confirm visitor authenticity, prevent fraudulent use of login data, and protect visitor data from unauthorized access. | 3 months | |
__Secure-1PSIDCC | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 1 year | |
__Secure-3PSIDCC | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 1 year | |
1P_JAR | This cookie is a Google Analytics Cookie created by Google DoubleClick and used to show personalized advertisements (ads) based on previous visits to the website. | 1 month | |
NID | Show Google ads in Google services for signed-out users. | 6 months |
Analytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.
InformationAnalytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.
Cookie name | Description | Lifetime | Provider |
---|---|---|---|
_dc_gtm | Manage and deploy marketing tags through Google Tag Manager. | 1 year | |
1P_JAR | Gather website statistics and track conversion rates for Google AdWords campaigns. | 1 month | |
AEC | 1 month | ||
ar_debug | Debugging purposes related to augmented reality (AR) functionalities. | 1 month | Doubleclick |
IDE | The IDE cookie is used by Google DoubleClick to register and report the user's actions after viewing or clicking on one of the advertiser's ads with the purpose of measuring the effectiveness of an ad and to present targeted ads to the user. | 1 year | Doubleclick |
ad_storage | Enables storage, such as cookies (web) or device identifiers (apps), related to advertising. | 1 year | |
ad_user_data | Sets consent for sending user data to Google for online advertising purposes. | 1 year | |
ad_personalization | Sets consent for personalized advertising. | 1 year | |
analytics_storage | Enables storage, such as cookies (web) or device identifiers (apps), related to analytics, for example, visit duration. | 1 year |
Vinh Jacker | 09-17-2024
Magento 2 is a strong and flexible eCommerce platform. It takes advantage of various front-end technologies to deliver a seamless user experience. One such technology is LESS (Leaner Style Sheets), a dynamic preprocessor style sheet language that extends CSS with features like variables, mixins, operations, and functions. In this article, we will guide you through using LESS files in Magento 2 and delve into the various compilation modes for customizing and styling your store.
Magento 2 uses a LESS preprocessor to convert LESS files into CSS stylesheets. With your LESS files ready, you can proceed. To understand how Magento 2 compiles LESS files into CSS, it’s necessary to explore the step-by-step overview of how this process works:
Let’s look at this typical example of LESS syntax
@newcolor: #fff8e3;
#a {
background-color: @newcolor;
}
#b {
color: @newcolor;
}
After compilation, the above LESS code translates to CSS:
#a {
background-color: #fff8e3;
}
#b {
color: #fff8e3;
}
Now, you can deploy LESS in Magento 2. Let’s use the Magento Blank theme as an example. You need to include the following CSS file in the head section.
<head>
<link rel="stylesheet" type="text/css" href="css/styles-m.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="css/styles-l.css" />
<link rel="stylesheet" type="text/css" media="print" href="css/print.css" />
</head>
You need to ensure that these source CSS files are located in the following directories related to your Magento Blank theme:
<Magento_Blank_theme_dir>/web/css/styles-m.css
<Magento_Blank_theme_dir>/web/css/styles-l.css
<Magento_Blank_theme_dir>/web/css/print.css
By following these steps, you can use LESS in Magento 2 to manage and style your themes efficiently. This approach ensures cleaner, more maintainable CSS code for enhanced development workflows.
Magento 2 provides three modes for compiling .less files into .css files, meeting various development requirements:
In Magento 2, the system prioritizes .css
files specified in layout handles. If these files aren’t found, Magento will automatically search for .less
files with the same name and compile them according to the configured compilation mode.
Understanding these modes helps developers optimize their workflow based on project requirements. This will balance development convenience and production performance in Magento 2 theme development.
To configure this, follow the steps below:
Go to admin panel > Go to store > Configuration > Developer > Frontend Development Workflow
Client-side LESS Compilation Mode in Magento 2 compiles LESS files directly in the client’s browser using lib/web/less/config.less.js and lib/web/less/less.min.js
. It publishes .less
files to pub/static/frontend/<Vendor>/<theme>/<locale>
, ensuring immediate updates for @import
directives upon page reload.
Unlike server-side compilation, clearing pub/static/frontend/<Vendor>/<theme>/<locale>
after modifying LESS files is typically unnecessary. However, ensure correct handling of @import
directives and file changes to avoid directory clearance issues. This mode optimizes Magento 2 frontend customization by delivering real-time updates, enhancing development efficiency without server-side delays.
In server-side compilation mode, Magento 2 uses the PHP LESS compiler
Key points:
Cleaning Directories: Clear pub/static/frontend/<Vendor>/<theme>/<locale>/ and /var/view_preprocessed/*
directories after modifying LESS files.
Developer Mode: Automatically compiles to .css files when pages are loaded for quick development feedback.
Production Mode: Deploy CSS changes using the following command to ensure all necessary static files, including CSS generated from LESS, are ready for production:
php bin/magento setup:static-content:deploy
By choosing the appropriate mode, developers can adjust the workflow to fit the specific needs of their Magento 2 theme development, balancing between real-time updates and production efficiency.
We hope that this straightforward and easy-to-follow guide will help you use LESS in Magento 2 easily. By taking advantage of LESS, you’ll enhance your front-end development workflow and create more maintainable styles. If you have any problems while following this tutorial, feel free to let us know.
With over a decade of experience crafting innovative tech solutions for ecommerce businesses built on Magento, Jacker is the mastermind behind our secure and well-functioned extensions. With his expertise in building user-friendly interfaces and robust back-end systems, Mageplaza was able to deliver exceptional Magento solutions and services for over 122K+ customers around the world.
Related Post
Discover Shopify App Store – A Comprehensive Handbook 2024
Explore the Shopify App Store for tailored solutions to grow your business. Discover your perfect app today!
Top 10+ Shopify Store Name Generators: Ultimate Review Guide
By exploring the top 10+ Shopify store name generators, we aim to help you create unique and meaningful store names.
Should I Hire A Shopify Expert? Reasons, How-tos
This article will focus on the question “Should I hire a Shopify expert?”, unlock major reasons & practical tips to find the perfect fit for your business.
How to Make FAQ Page Shopify For SEO: A Comprehensive Guide
Confused by customer questions? This article aims to guide you how to make faq page Shopify that saves your time and boosts sales.
Top 10 Shopify ERP Solutions to Improve Operation Efficiency
Discover the top 10 Shopify ERP solutions to streamline your business operations, improve efficiency, and automate inventory management & order fulfillment.
Discover Shopify App Store – A Comprehensive Handbook 2024
Explore the Shopify App Store for tailored solutions to grow your business. Discover your perfect app today!
Top 10+ Shopify Store Name Generators: Ultimate Review Guide
By exploring the top 10+ Shopify store name generators, we aim to help you create unique and meaningful store names.
Should I Hire A Shopify Expert? Reasons, How-tos
This article will focus on the question “Should I hire a Shopify expert?”, unlock major reasons & practical tips to find the perfect fit for your business.
How to Make FAQ Page Shopify For SEO: A Comprehensive Guide
Confused by customer questions? This article aims to guide you how to make faq page Shopify that saves your time and boosts sales.
Top 10 Shopify ERP Solutions to Improve Operation Efficiency
Discover the top 10 Shopify ERP solutions to streamline your business operations, improve efficiency, and automate inventory management & order fulfillment.
Make sure your store is not only in good shape but also thriving with a professional team yet at an affordable price.
Get Started