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
18 votes
1 answer
9k views

@media-common - Why do we need to use this?

In the Magento 2 lib documentation it contains the following: @media-common: true|false - sets whether to output common styles. For common styles every time you want to add some styles you should use ...
Ben Crook's user avatar
  • 15.6k
4 votes
4 answers
13k views

After deleting files under 'view_preprocessed' folder they dont appear again when reloading site

I'm testing some small LESS changes in my theme. After every change I delete the contents inside: pub/static/frontend/mytheme and var/view_preprocessed Then I reload my site and the contents of ...
Luis Garcia's user avatar
  • 1,629
16 votes
4 answers
24k views

Less files in custom modules

How do you use less inside custom module having created code/Vendor/module/view/frontend/web/css/source/custom.less how do I include and compile?
fefe's user avatar
  • 927
0 votes
2 answers
2k views

Is my LESS getting included twice?

As part of creating a custom theme, and partially following the guide on the Magento site, I added a LESS file at: <theme-dir>/Vendor/theme/Magento_Customer/web/css/source/_extend.less When I ...
andyjv's user avatar
  • 3,232
0 votes
1 answer
1k views

Change the text color of system emails

How do I change the font color of system emails like "forgot password". I currently have white font color and white background. I need this to work in Outlook, Thunderbird an any webmailer. I tried ...
Philipp Sander's user avatar
2 votes
1 answer
672 views

Magento2: slow loading after change less file

I'm trying to create new theme. But every time I reload the home page it is going to high CPU loading. My Settings: New theme has just one file: /app/design/frontend/Test/default/web/css/source/...
Nikolaev's user avatar
0 votes
1 answer
61 views

Why styles are not getting applies when edited in magento2

In magento2.0.2(downloaded from magentocommerce.com), after installation I created a new theme under app/design/frontend/mypackage with theme.xml , registration.php , composer.json as per the ...
Ramya's user avatar
  • 1,088
40 votes
1 answer
34k views

How do you override LESS in a custom theme?

I've spent the better part of this week trying to find a clear guide on how to properly create a custom theme and extend exist LESS/CSS without having to copy the entire magento-blank theme. The ...
andyjv's user avatar
  • 3,232
1 vote
1 answer
169 views

Magento2 include new css file

I want to include a new css file styles.css. Steps I've taken: 1) switch to developer mode (magento deploy:mode:set developer); 2) edit dev/tools/grunt/configs/themes.js and include my theme with my ...
Claudiu Creanga's user avatar
0 votes
2 answers
4k views

Error in Magento 2 when trying to deploy

I have this error: Fatal error: Class 'Locale' not found in vendor/magento/framework/Locale/Bundle/DataBundle.php on line 64 in Magento 2 when I try do use this command to clear the cached ...
Mihai Ilie's user avatar
5 votes
1 answer
7k views

How to utilise the existing LESS variables in my new less file

As the title says, i want to use LESS variables that are already defined by Magento. for example, there is variable called @color-white defined in following file. ROOT/lib/web/css/source/lib/...
Nero's user avatar
  • 749
0 votes
1 answer
231 views

how to create file of type less with php in magento2?

I want to use LESS in Magento 2 with PHP code. Example: If I want to create CSS with PHP in Magento 2, I can create a file custom.phtml and then in XML I would use referenceContainer. custom.phtml &...
xanka's user avatar
  • 2,104
0 votes
2 answers
5k views

Change CSS for navigation bar

I'm using the Luma theme. I would like to change the padding for the a-tag tag used in the navigation submenu. I can change the backgroundcolor of the items (li) like this, @navigation-desktop-...
Omitri's user avatar
  • 333
10 votes
3 answers
16k views

Overriding Blank Theme Styles in Magento 2

How would you go about overriding the navigation styles for a custom theme when inheriting from the blank theme in Magento 2? I have a theme.css file in my app/design/frontend/<Vendor>/<...
Gareth Daine's user avatar
3 votes
1 answer
2k views

Magento 2: Less Compilation Failing

I'm working with a set of Less CSS files I didn't write in Magento 2. During compilation, I get the following error Compilation from source: frontend/Infortis/base/en_US/css/custom.less ...
Alana Storm's user avatar
  • 44.3k
2 votes
5 answers
13k views

Problem while compile less in custom theme of magento 2

In folder app\design\frontend\Vendor\theme\web\css\_styles.less It already @import 'source/lib/_lib.less' this will define variables/_colors.less But i can't figure out why magento raise undefine ...
mrtuvn's user avatar
  • 3,263
3 votes
2 answers
927 views

how to compile single LESS file in magento2

I am working on magento2 theming part. Here we have some predefined and my custom LESS file. Whenever we compile LESS file, it generates two css file -- styles-l.css, styles-m.css . But we do not know ...
Aditya Kumar's user avatar

1 2 3 4 5
6