- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Default css files are formatting to default stage after using setup:upgrade command
i have done some modifications in default CSS files like style-m.css and style-i.css.
if i do upgradation(setup:upgrade) modifications in css file are missing.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Default css files are formatting to default stage after using setup:upgrade command
Hello @sekhar_n
Run below commands after upgrade command:
php bin/magento setup:static-content:deploy
set the permission if required.
https://www.manishmittal.com/
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Default css files are formatting to default stage after using setup:upgrade command
Manish,
My Problem is if i write a code like
.product-info-price .price:after {
content: '(Include GST)';
font-size: xx-small;
font-weight: 400;
margin-left: 10px;
} in magento default css files(styles-i and styles-m).
if i run setup:upgrade command the above code is removing from magento default css files automatically.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Default css files are formatting to default stage after using setup:upgrade command
Hello @sekhar_n
are you changing directly in pub folder?
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 (inheritance is defined within theme.xml). If you are already using some theme then skip this step.
- edit .less within your theme so the changes stay visible and don't get replaced when clearing the cache or upgrading the system.
- Use grunt to compile your .less into deployment files.
- You can also setup sourcemaps to pin point your styling within the theme .less files so you can be more productive.
Some useful references:
- Getting started with Less
- Less debugging in Magento 2
- Create a theme in Magento 2
- Getting started with Grunt
- Magento UI Library
This is the flowchart that how magento2 process css files (source: inchoo)
https://www.manishmittal.com/