How to modify CSS files in Magento 2
In Magento 2, do not modify CSS files within pub/* or vendor/* directories, because pub is for deployment and vendor is for default structure. Instead:
- Create a new theme in app/design/frontend/{vendor}/{yourTheme}/, as well as a new theme which inherits from Blank.
- Edit an appropriate .less file. Don’t get replaced when clearing the cache or upgrading the system.
- Utilize Grunt for compiling .less into deployment files.
- Setup sourcemaps to pinpoint your styling within the theme .less files. This step improves your productivity.
Source: