4

For CSS, I found that we can add web/i18n/en_US/mymodule.css for module

If I want to add some locale specific CSS for the core module, where should I put them in? e.g. app/design/frontend/mypackage/mytheme/Magento_Catalog/web/i18n/en_US/catalog.css ?

But if I want to add locale specific .less file, how can I do this?

poojan sharma
1,5561 gold badge11 silver badges16 bronze badges
asked Nov 10, 2016 at 4:45
2

3 Answers 3

1

You can add new CSS to the head of all your template pages.

Create /Magento_Theme/layout/default_head_blocks.xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <head>
 <css src="css/custom.less" />
 </head>
</page>
answered Dec 4, 2016 at 7:38
2
  • how about for locale(multi-language) specific css? Commented Dec 13, 2016 at 6:18
  • If its same theme then you can use same XML if its different the add there too in XML Commented Dec 13, 2016 at 7:17
1

Simple ways to customize a theme's styles for magento2

Simplest way to extend parent styles

To extend the parent theme’s styles in your theme:

In your theme directory, create a web/css/source sub-directory.
Create a _extend.less file there. The path to it looks like following:
<theme_dir>/
│ ├── web/
│ │ ├── css/
│ │ │ ├── source/
│ │ │ ├──_extend.less

for locale specific less, use this path

<theme_dir>/web/i18n/locale/css/source/_extend.less

answered Nov 29, 2017 at 8:39
-1

locale-specific not possible.

for locale assign you must need to assign store view.

For each store wise you can create new theme and assig it.

Hope it will clear your idea.

answered Nov 29, 2017 at 8:43
1
  • This isn't true. You can do locale specific styles and all other static content (images, js, css, fonts, ...) just by placing the files as @situee explained. Commented Mar 14, 2022 at 11:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.