Questions tagged [less]

Less is an open-source stylesheet preprocessor that extends CSS with dynamic behavior such as variables, mixins, operations and functions. For the UNIX command, use [less-unix].

Filter by
Sorted by
Tagged with
0 votes
2 answers
108 views

add css in Magento 2

suppose I need to add following changes in my css: .border{1px solid #cecece} .box{float:left} I am stucked to add these in my styles, i can only see .less files and not sure how it works.
Rohit's user avatar
  • 21
1 vote
0 answers
240 views

Ultimo Less files dont compile

I am using the Ultimo theme. As per its documents it says to make a child theme and then add any custom css in the provided less file. I have done this but it is difficult to get it to generate the ...
Guerrilla's user avatar
  • 187
0 votes
1 answer
145 views

LESS w/ Grunt - Solutions For M2's Terrible LESS Workflow?

M2 has a grunt / LESS workflow that allows you to automatically compile and view your changes in the browser. However, I can rarely get the live reload to work with the Chrome extension, and when it ...
Harry Manback's user avatar
6 votes
5 answers
11k views

How to configure the theme to use Grunt?

I normally change the file /dev/tools/grunt/configs/themes.js but in the .gitignore we can see a configuration file called /dev/tools/grunt/configs/local-themes.js I'd like to use that file instand a ...
Rafael Corrêa Gomes's user avatar
2 votes
2 answers
2k views

How to set frontend compilation via the database

How do you set the front-end workflow option via the DB rather than the admin? This is the setting I'm referring to: Stores > Configuration > ADVANCED > Developer > Front-end ...
Ben Crook's user avatar
  • 15.6k
19 votes
1 answer
11k views

Best way to extend module less found in web/css/source/module, like _minicart.less?

Which is then the best way to extend less files content in <module>/web/css/source/module/, like for instance Magento_Checkout/web/css/source/module/_minicart.less? Assuming that to A) ...
Loreena's user avatar
  • 620
0 votes
1 answer
478 views

Static Content missing less files

I have set the client side compilation mode on within admin and have recieved lots of missing files errors. Error: FileError: 'http://magento2.com/static/version1493890573/_cache/merged/source/_theme....
harri's user avatar
  • 5,415
7 votes
2 answers
1k views

Why does gallery.less include _theme.less?

I have a theme that extends luma using _theme.less. On product pages, another CSS file is included in addition to styles-m. The problem is that they both @import _theme.less which results in duplicate ...
Domeglic's user avatar
  • 532
0 votes
2 answers
257 views

CSS stopped working in my Magento 2 theme

I had been trying to set up a theme in Magento 2 several weeks ago and now when I try to continue the work, it seems that the CSS on the site has stopped working for my theme. The site loads without ...
JWeiss's user avatar
  • 33
2 votes
2 answers
6k views

Grunt less:theme fails @media-common is undefined

I am using a theme that I have created based on a third party theme 'Optimus' and I am trying to use Grunt to compile the LESS. However, when I run grunt less:theme it fails with the following error: ...
Phillip Meyer's user avatar
0 votes
1 answer
3k views

Magento 2 - Custom Module's _module.less file not updating

In a custom module I've created I'm using a _module.less file in it. At first it worked but any changes I make to it are not updating on the frontend. I think it must be a cache issue but so far ...
Holly's user avatar
  • 4,823
1 vote
1 answer
556 views

Grunt themes.js file overwritten when running composer install

When running the composer install command the www/dev/tools/grunt/configs/themes.js file is being overwritten and removing the config for my custom theme. When searching online I came across the ...
Ryan Copeland's user avatar
2 votes
0 answers
24 views

How to add new theme name to grunt CLI command to run grunt tool in Magento 2 with CLI commands instead of editing less.js and themes.js file?

I read this , But I wanna add new theme name to grunt CLI command with some CLI commands not editing a less.js and thmemes.js manually.Is there any solution for this something Like (magento2 add-...
ali gh's user avatar
  • 731
2 votes
2 answers
2k views

How to extend gallery.css in Magento2?

How do you extend gallery.css in Magento2? gallery.css is loaded after styles-m.css so anything that I put in my theme's _extend.less the file gets overwritten by it. I don't want to override ...
Holly's user avatar
  • 4,823
4 votes
2 answers
2k views

Grunt watch doesn't watch _theme.less and custom less file

That's my css/source file structure: https://i.stack.imgur.com/5tNxJ.png I made grunt clean, theme exec, theme less, watch. Watch is responsive to any less file changes accept of _theme.less and ...
Max.A's user avatar
  • 107
1 vote
1 answer
257 views

Email.less is pulling in theme.less adding unnecessary styles to sales emails

Email.less is pulling in theme.less adding unnecessary styles to sales emails. This is happening in our parent blank theme in the vendor folder. Is there a way to kill the @import so its not being ...
Matthew McLennan's user avatar
0 votes
2 answers
262 views

How do you search css in related less file in Magento 2?

I want to change some css in header let says media="screen and (min-width: 768px)" @media (min-width: 768px), print styles-l.css:1 .page-header { border: 0; margin-bottom: 0; background: #...
hkguile's user avatar
  • 2,201
1 vote
2 answers
3k views

Can't get Magento2's .media-width() LESS mixin to work

I'm trying to use Magento2's .media-width() mixin. I followed the instructions from the devdocs and added the mixin in my theme like this: .logo img { width: 125px; height: 29px; .media-width(@...
Holly's user avatar
  • 4,823
0 votes
1 answer
581 views

How change menu in Magento 2?

I try change text-transform:none; to text-transform:uppercase; in horisontal menu theme LUMA. I try add to _theme.less: @navigation-level0-item__text-decoration: uppercase; @navigation-desktop-level0-...
Sylon's user avatar
  • 77
3 votes
2 answers
3k views

How to remove lib-font-face from Magento 2

I've created a theme in Magento2 which inherits from the Luma theme. So it has inherited it's lib-font-face, which can be found in the styles-m.css @font-face { font-family: 'luma-icons'; src: ...
Holly's user avatar
  • 4,823
8 votes
1 answer
5k views

How to enable CSS source Maps for Magento 2

How do you enable CSS source Maps for Magento 2's front-end workflow. I'm learning M2 and have created a custom theme, called "mytheme", inheriting from the out-of-box luma theme. I'd like to use ...
Holly's user avatar
  • 4,823
0 votes
1 answer
55 views

Magento2 CSS Rule Overriding

At 300px the page body has 0.3 opacity. For some reason, regardless of the order of these rules in the less file - they are always outputted into the file in the wrong order. Am I being stupid? Is ...
LM_Fielding's user avatar
  • 1,533
1 vote
2 answers
2k views

Can't get Grunt working for Magento 2

I can't get Grunt working on Magento 2. I'm going through the devdocs and have run the following commands to set up grunt: $ sudo npm install -g grunt-cli /usr/bin/grunt -> /usr/lib/node_modules/...
Holly's user avatar
  • 4,823
0 votes
3 answers
2k views

How add custom style max width 1024 Magento 2?

I have: .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { padding: 50 px; } Css looks: @media (min-width: 768px) { padding 50px } Need make: @media (max-width:...
Sylon's user avatar
  • 77
3 votes
1 answer
59 views

Is my current way to create a new Magento2 theme the correct method?

I have to create new theme that looks the default Magento Blank theme (other colors, other font). That's why I created a new theme with 1 file less css/source/_theme.less. This file _theme.less looks ...
user3310748's user avatar
3 votes
2 answers
2k views

NameError: variable @font-family-name__base is undefined

This has been asked before, but I'm still not finding a solution. When using client side compile I get "NameError: variable @font-family-name__base is undefined". I've deleted everything and ...
Harry Manback's user avatar
0 votes
1 answer
2k views

Override Less file

im work on a new magento 2 page. Now i want change a css class over my custom theme.less file. But how can i override the css class? I want override the padding from the .header.content class which ...
user3778868's user avatar
0 votes
2 answers
2k views

Modify CSS in magento 2

I am quite new to magento 2 and am trying to get my head around less and scss (new to this too). At the moment I just want to change the orange border at the bottom of the active Magento navigation ...
harri's user avatar
  • 5,415
1 vote
0 answers
95 views

why Magento2 serves LESS files when I'm in server-side-less-compilation modus?

I have changed my admin-config LESS compilation modus to: Client side less compilation. Now I have changed it back to: Server side less compilation. But my admin panel and webstore still serve less ...
user3310748's user avatar
6 votes
3 answers
5k views

Why clear pub/static/frontend after css changes in dev mode?

I am working with Magento2 and have a question. I am working in the development mode. But when I do some CSS changes in my theme, why I have to manually clear the pub/static/frontend folder every ...
user3310748's user avatar
1 vote
0 answers
57 views

Error when compile file custom.less to custom.css in Magento 2.1 [solved]

I have file custom.less .page-header { margin: auto; } .brand-logo { display: block; text-align: center; position: absolute; left: 50%; } I use comment php -dmemory_limit=6G bin/magento ...
user3408888's user avatar
0 votes
1 answer
137 views

magento 2 grunt less don't see changes in few files

I have problem with Grunt watch. All works good but for example for _theme.css, but don't see any changes after I changing _extend.less what can be wrong?
Lucas D's user avatar
  • 51
0 votes
1 answer
83 views

Same LESS file, one media-width works, the other doesn't?

I have a custom theme with the parent of blank. In web/css/source I have_navigation_extend.less. At the top I have .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__l) ...
Aaron's user avatar
  • 259
1 vote
2 answers
109 views

Changing CSS files in Magento 2.1.2

Currently trying to change the top menu background color, tried to change it from the CSS files, found out through firebug that the file pub/static/frontend/Venustheme/beat/en_US/css/styles-l.css is ...
Wat's user avatar
  • 11
4 votes
2 answers
138 views

Why does M2 place all CSS in inline <style> tags in the header?

I've set up a site and I must have some strange configurations, because ALL applied styles on the entire site are coming from inline tags in the header: If you check the markup it comes from this ...
Joshua Soileau's user avatar
2 votes
1 answer
759 views

SyntaxError: Cannot read property 'numerator' of undefined in pub\static\fron \package\theme\en_US\css\source\lib\_responsive.less

SyntaxError: Cannot read property 'numerator' of undefined in pub\static\frontend\package\theme\en_US\css\source\lib_responsive.less on line 44, column 9: 43 @media only screen and (max-width: ...
Satish Rana's user avatar
  • 1,471
0 votes
1 answer
221 views

How I can see the native intern Magento 2 UI library?

I run the grunt documentation but I can't be able to see the docs, I saw a 404 page, why? http://dev.local/redstore/lib/web/css/docs/index.html
Rafael Corrêa Gomes's user avatar
3 votes
1 answer
2k views

Override link color in custom less file, Magento2

I want to change the color of the links in my template. How can I achieve this by using _theme.less?
Max's user avatar
  • 1,834
0 votes
1 answer
2k views

Magento 2 Blank Theme: How to reduce the height of Navigation, header and top links?

I want to reduce the height of the top sections (navigation, logo, search and top links) in the default Magento Blank theme but I cannot figure out how to do this. I have created _extend.less and ...
Phillip Meyer's user avatar
1 vote
0 answers
2k views

bootstrap into luma extended theme - magento2

I created theme that extend luma. I have integrated bootstrap into magento using this link after that product detail page and page header alignment are not nice. Due to commonalities between these ...
Bilal Usean's user avatar
  • 9,917
1 vote
1 answer
100 views

Magento 2 - Magento 2 - Why is less file loading first? Need it to load after css files

I am using grunt/M2 & I noticed my less files are loading before my css files in my Magento 2 website. Any ideas? I need the less file to load last so it overwrites classes. Here is what's in my ...
Kara's user avatar
  • 179
0 votes
1 answer
355 views

Magento 2.1 LESS compilation issues

I'm trying to understand exactly how / when LESS files get compiled and unfortunately I'm not much further than what I started. I tried installing grunt, but I'm having all kinds of permission ...
user1608993's user avatar
5 votes
1 answer
2k views

How do you include a custom LESS file inside of a child theme?

I'm starting a new project using Magento 2.1 and I'm a little confused on how LESS compilation works. I created a child theme using a purchased theme as the parent. Inside my child theme, I added ...
user1608993's user avatar
1 vote
0 answers
241 views

Custom styles not work in new theme Magento 2

Read a lot: Create a storefront theme My steps: Create a theme directory app/design/frontend/My-vendor/default Copy all files from vendor/magento/theme-frontend-luma to app/design/frontend/My-vendor/...
Sylon's user avatar
  • 678
2 votes
1 answer
2k views

How to correctly add my less file to Magento 2?

Create theme app/design/frontend/Vendorname/default Try add my.less file for impot, or add code with new class and style to _extends.less to app/design/frontend/Vendorname/default/web/css/sourse. rm -...
Sylon's user avatar
  • 678
2 votes
1 answer
97 views

Magento 2.0.7 grunt:less problem

I'm using DigitalOcean one-click-install Magento 2.0.7 installation on ubuntu and I have installed nodejs and grunt following the official tutorials. I added my theme to /dev/tools/grunt/configs/...
raouaoul's user avatar
  • 307
1 vote
1 answer
1k views

Change button add to cart color

I've successfully changed it once by this. Cascading style sheets (CSS) then I want to change it to other colors, but my new code are not working, the color is still the old one. I change like this(...
mio's user avatar
  • 27
0 votes
0 answers
783 views

Change .product-item-name font-weight to bold

How to change .product-item-name (see image) font-weight to bold in my Magento 2 child theme? My parent theme is Luma theme. I can't find in which less file: .product-item-name, .product.name a { ...
meez's user avatar
  • 417
0 votes
0 answers
809 views

How to style th and td tag in data table additional-attributes

I need to style the th and td tag in the 'additional-attributes' table (under the More information tab), with the css class: data table additional-attributes. See screenshot. Where (which less file) ...
meez's user avatar
  • 417
0 votes
1 answer
144 views

Problem with extending Luma theme using Grunt with Less

I am trying to extend from the Luma theme in Magento 2.1 but I ran into several problems. First of all, my theme isn’t extending properly. The templates and xml files all seem to work. My clients ...
Pixelspin's user avatar