how to edit custom css or less in Magento 2? - magento

I had installed magento 2.0.2 and also override the templates
I am stuck on a point that where do i write my css for my own styling.
How do i change the css of existing template.

app/design/frontend/namespace/yourtheme/web/css/source/_theme.less
start with changing the header background
.page-header {
background-color: #000;
}
check this also

Related

Overriding font-family via userContent.css doesn't work

I'm trying to override font-family via userContent.css in all web pages. My ultimate goal is to only target Persian/Arabic text in the css but that's a separate issue.
I started with a simple global rule below but Firefox does not pick it up:
* {
font-family: "Vazirmatn" !important;
}
I noticed the changes are picked in firefox's chrome, for instance the text in the Inspector but not in actual websites. I added below to target content of websites but it wasn't effective:
#-moz-document url-prefix('http://'), url-prefix('https://') {
* {
font-family: "Vazirmatn" !important;
}
}
Am I missing something?
Some sanity checks:
toolkit.legacyUserProfileCustomizations.stylesheets is set to True
the same CSS works if I use the Stylish extension but I prefer to use the native userContent.css if possible
"Allow pages to choose their own fonts, instead of your selections above" is set to True in settings
I'm on Firefox 106.0.2

Nuxt.js is not importing font-face properly

I'm using custom font files with Nuxt project. I tried to add font files to /static/fonts and import them using
font-family: 'coconregular';
src: url('fonts/cocon-regular-font.woff2') format('woff2'),
url('fonts/cocon-regular-font.woff') format('woff');
font-weight: normal;
font-style: normal;
}
$cocon: 'coconregular';
.brand-name {
font-family: $cocon;
}
I'm having '#nuxtjs/style-resources' installed and all other variables and SCSS loading is working totally fine but fonts are not loading.
This is my file structure
files screenshot
I can't find a way to add fonts properly neither i don't know how to check if the font is loaded. There aren't any errors.
What is the correct way for Nuxt and SCSS to load fontfiles?
So i finally figured out good workaround. I don't know if this is good or not, but i separated fonts download from anything else. Therefore i added another entrypoint to nuxt.config.js to include fonts stylesheet before other stuff.
css: [
'#/assets/scss/theme/fonts/stylesheet.css',
'#/assets/scss/main.scss'
],
It worked good because My fonts stylesheet for Woff and Woff2 files were generated by font squirrel generator anyway.
Hope this helps you guys

The CSS for my deployed NuxtJs site is not working

I've found some problems similar to mine, but nothing close enough for me
I've built a blog-site using NuxtJs with Vuetify and have deployed it on Netlify. The site looks and works great for the most part. My site has a navigation drawer that is supposed to have a background-color of #659dbd. This color shows up in development. However, on the deployed site, the background-color is white. When I inspect the site in my dev tools, this color does show up in the styles, but it has a line through it, like this:
Does anyone have any idea what could be causing this?
I've looked at the Netlify gotchas, but couldn't anything regarding anything like this.
It's strange because all of my other stylings render fine.
If I've left anything out or if you need to see any code, let me know.
This happens because you probably using nuxt/vuetify module, and for development it use builded vuetify bundle, but for production it use treeshake version. And with treeshaken version of vuetify it do load css dynamically on page. So first loaded your page style, adn then vuetify load its own component styles and it overrides your own styles
There's probably some other more specific rule.
<div class="list">
<div class="drawer"> Item </div>
</div>
<style>
.list {
background-color: #4589e0;
}
.drawer {
background-color: #1707a3;
}
.list .drawer {
background-color: #a3073b;
}
</style>
Read more about it here: https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity

October CMS Theme CSS

I am new to use October cms but everything goes well until I change css.
Create a navbar with a class (.navtest) that is located in the theme.css / assets folder. Added a background: red;
To see something happening, have also tried with !important but no things happen. have tried to change css / bootstrap.css that comes with demo theme but nothing happens then either.
So I do not know what I'm doing wrong. Is it someone who has a solution?
Thanks
October allows you to combine CSS in bundles, these bundles can be cached in production. Try clearing your cache, for example with
https://octobercms.com/plugin/romanov-clearcachewidget

How to change css in prestashop 1.7

Recently I started to work with prestashop 1.7.
Does anyone know how to force recompilation of css by changing the ../_dev/css/theme.scss?
I try:
#wrapper {background: red;}
But in ../assets/css/theme.css remains
#wrapper {background: #ebebeb;}
compiled by Webpack from the _dev files.

Resources