New answers tagged

0

You can enable it via admin panel Stores > Settings > Configuration > ADVANCED > Developer or via terminal. bin/magento config:set dev/css/use_css_critical_path 1 How to use it You can create a critical.css in your custom theme as the example below. app/design/frontend/<your_vendor_name>/<your_theme_name>/web/css/critical.css ...


0

All CSS styles loaded from external files are considered as render-blocking. This means that a web page will not be displayed until these files are loaded. By using ‘CSS critical path’, we deliver minified critical CSS inline in <head> and defer all non-critical styles that are loaded asynchronously. Thus we can significantly improve the time to first ...


0

You can set in your module layout xml > if yes please accept this post.


0

you can follow this blog to add js and css https://meetanshi.com/blog/add-custom-css-and-js-in-magento-2/


0

Did you have CSS styles merged? Possibly, unmerging CSS files should fix the issue (System-Confguration-Advanced-Developer-CSS Setting-Merge CSS files). However, you will need HTTP/2 on the server side, use compact version of styles, or even setup static compression to keep the same performance.


0

in my case it was all folder permession , the easy fix is to just do the following: 1- change the /pub folder permission to 777: sudo chmod 777 pub -Rf 2- redeploy the site static contents: bin/magento setup:static-content:deploy -f in case u have multi-lang site, write like this: bin/magento setup:static-content:deploy -f en_US ar_SA


0

in my case it was all folder permession , the easy fix is to just do the following: 1- change the /pub folder permission to 777: sudo chmod 777 pub -Rf 2- redeploy the site static contents: bin/magento setup:static-content:deploy -f in case u have multi-lang site, write like this: bin/magento setup:static-content:deploy -f en_US ar_SA


0

That error occurs when your CSS is returning a 404 error, it means the browser is expecting CSS but has received text or HTML (the 404 error). So you need to figure out why your CSS is missing, have you fully recompiled your frontend and cleared cache? If the CSS is still not rendering there could be an error preventing it from being compiled. It's hard to ...


1

You need to use class catalog-category-view instead of category because there is no such class category on category page! Your code should be: @media (max-width: 767px) { .catalog-category-view .sidebar .sidebar-main { display: none; }


1

Step 1: Create default_head_blocks.xml like below locations in your theme app/design/frontend/Test/Theme/Magento_Theme/layout/default_head_blocks.xml and add the below code in it <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/...


2

You should not edit/modify files within pub/* or vendor/* directory. Pub is for deployment and vendor is for default structure, which you override via your template or custom modules. Instead: Create a new theme inside app/design/frontend/{vendor}/{yourTheme}/. You can use Blank or Luma theme. You can also create new theme which inherites from Blank (...


1

Did you changed the CSS in pup/static folder.If you did it is wrong. You need to change it's related less or css file in module/theme. After that run the required commands.


1

First correct path file _typography.less should be app/design/frontend/yourTHEME/VENDOR/web/css/source/_typography.less you need add font like below .lib-font-face( @family-name: 'review-stars', @font-path: '@{baseDir}fonts/ReviewStars/icomoon', @font-weight: normal, @font-style: normal, @font-display: swap );


1

create default.xml in app/code/yourvendor/yourmodulename/view/frontend/layout add this below lines of code in it:- <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/...


1

To add css or js use vendor_module::style.css Refer this link for more info http://this-adarsh.epizy.com/module-development-3/ Happy Magento


Top 50 recent answers are included