You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: guides/v2.1/frontend-dev-guide/css-topics/css_debug.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -84,14 +84,15 @@ grunt watch | Tracks the changes in the source files, recompiles `.css` files, a
84
84
85
85
The following shows which Grunt tasks to use for debugging:
86
86
87
-
- After you switch the compilation mode from client-side to server-side, run the `exec` command.
88
-
- After you customize the content of any `.less` file, except the root source files, run the `less` task and reload the page.
89
-
- After you [customize the root source files or move the files included to the root files]({{ page.baseurl }}/frontend-dev-guide/css-topics/css-preprocess.html), run the `exec`command and reload the page.
90
-
- After you run the `exec` command, run the `clear`command to `clear` the Magento cache, then run the `watch` command. Running the commands in this order will ensure that any custom jQuery attributes like product sliders, banners, etc are loaded correctly.
87
+
- After you switch the compilation mode from client-side to server-side, run the `exec` command.
88
+
- After you customize the content of any `.less` file, except the root source files, run the `less` task and reload the page.
89
+
- After you [customize the root source files or move the files included to the root files]({{ page.baseurl }}/frontend-dev-guide/css-topics/css-preprocess.html), run the `exec`command and reload the page.
90
+
- After you run the `bin/magento setup:upgrade` command, run the `exec` command.
91
+
- After you run the `exec` command, run the `clear`command to `clear` the Magento cache, then run the `watch` command. Running the commands in this order will ensure that any custom jQuery attributes like product sliders, banners, etc are loaded correctly.
91
92
92
93
If you have LiveReload installed, run the `grunt watch` command, and the flow is even simpler:
93
-
- After you customize the content of any `.less` file, changes are applied and the page reloads automatically. No additional changes are required.
94
-
- After you [customize the root source files or move the files included to the root files]({{ page.baseurl }}/frontend-dev-guide/css-topics/css-preprocess.html), run the `clean` and `exec` commands, and the browser page reloads automatically.
94
+
- After you customize the content of any `.less` file, changes are applied and the page reloads automatically. No additional changes are required.
95
+
- After you [customize the root source files or move the files included to the root files]({{ page.baseurl }}/frontend-dev-guide/css-topics/css-preprocess.html), run the `clean` and `exec` commands, and the browser page reloads automatically.
95
96
96
97
97
98
## CSS source maps {#source_maps}
@@ -112,7 +113,6 @@ The path to the CSS source maps configuration differs, depending on the browser.
112
113
113
114
In Google Chrome, to enablesource maps generation, go to **Inspect**>**Settings**>**Preferences**>**Enable CSS source maps**.
114
115
115
-
116
116
Magento has a base set of variables that define commonly used aspects of a theme; such as colors, fonts, style of page titles, and so on.
117
117
118
118
The `<magento-root>/lib/web/css/source/lib/variables` directory contains LESS files that define values assigned to variables formany of the common elementsin Magento.
@@ -121,7 +121,7 @@ To change or override any of these variables, simply create a file in `<theme-di
Copy file name to clipboardExpand all lines: guides/v2.1/frontend-dev-guide/css-topics/theme-ui-lib.md
+27-7Lines changed: 27 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -34,12 +34,13 @@ The Magento UI library provides the ability to customize and reuse the following
34
34
35
35
The following illustration shows a {% glossarytooltip 1a70d3ac-6bd9-475a-8937-5f80ca785c14 %}storefront{% endglossarytooltip %} product page containing some of the preceding elements:
36
36
37
-
![A product page with user interface elements specified][ui_lib1.png]
37
+
![*A product page with user interface elements specified*][ui_lib1.png]
38
38
39
39
## Mixin location {#fedg_using-ui-lib_mixins}
40
40
41
-
You can find the Magento UI library under [`lib/web/css`].
41
+
You can find the Magento UI library under [`lib/web/css`][].
42
42
Library source `.less` files are stored under the `source` directory, each file contains mixins for configuring a certain element, and in most cases the element coincides with the file name:
If your theme [inherits] from any Magento out-of-the-box theme, for example Blank, you can easily customize any element of a store page without changing any {% glossarytooltip 6c5cb4e9-9197-46f2-ba79-6147d9bfe66d %}CSS{% endglossarytooltip %} code or templates.
89
+
If your theme [inherits][] from any Magento out-of-the-box theme, for example Blank, you can easily customize any element of a store page without changing any {% glossarytooltip 6c5cb4e9-9197-46f2-ba79-6147d9bfe66d %}CSS{% endglossarytooltip %} code or templates.
89
90
Customization can be performed by simply changing in your theme the values of the predefined variables used in the UI library or parent theme mixins.
90
91
91
-
The complete list of these variables and their default values are stored in [`lib/web/css/source/lib/variables`].
92
+
The complete list of these variables and their default values are stored in [`lib/web/css/source/lib/variables`][].
92
93
This directory contains a set of files, corresponding to the set of UI library elements, and each of the files lists element-specific variables.
93
-
For example, [`lib/web/css/source/lib/variables/_breadcrumbs.less`] contains variables used in the `breadcrumbs()` {% glossarytooltip 1a305bdb-9be8-44aa-adad-98758821d6a7 %}mixin{% endglossarytooltip %}.
94
+
For example, [`lib/web/css/source/lib/variables/_breadcrumbs.less`][] contains variables used in the `breadcrumbs()` {% glossarytooltip 1a305bdb-9be8-44aa-adad-98758821d6a7 %}mixin{% endglossarytooltip %}.
94
95
95
96
To change the default library variables values, specify the new values for the required variables in the `<theme_dir>/web/css/source/_theme.less` file.
96
97
@@ -101,7 +102,7 @@ So if you want to inherit the parent theme's variable values additionally to you
101
102
The following figure shows the product page shown earlier in this topic, after a custom theme was applied.
102
103
The theme customized Blank by redefining variables only.
103
104
104
-
![Changing design by redefining variables][ui_lib2.png]
105
+
![*Changing design by redefining variables*][ui_lib2.png]
105
106
106
107
## Your custom variables {#fedg_using-ui-lib_vars}
107
108
@@ -114,12 +115,15 @@ The following paragraphs describe both ways to call a mixin.
114
115
115
116
To use a mixin with default values, call the mixin without specifying any parameters.
116
117
For example:
118
+
117
119
```css
118
120
.breadcrumbs {
119
121
.lib-breadcrumbs();
120
122
}
121
123
```
124
+
122
125
To call a mixin with parameter values different from default, set these values when calling the mixin, like in the following example:
126
+
123
127
```css
124
128
.example-button {
125
129
.lib-button(
@@ -137,7 +141,8 @@ Variables starting with `@` (without the underscore) are global, and are listed
137
141
Use the accordion style for mobile and tab style for desktop.
138
142
139
143
To set tabs and accordions using breakpoints, see the following example:
140
-
```text
144
+
145
+
```css
141
146
& when (@media-common = true) {
142
147
.product.data.items {
143
148
.lib-data-accordion();
@@ -150,6 +155,21 @@ To set tabs and accordions using breakpoints, see the following example:
150
155
}
151
156
}
152
157
```
158
+
## Navigation set with CSS
159
+
160
+
Use the Navigation style for mobile and tab style for desktop.
161
+
162
+
To set navigation using breakpoints, see the following example:
163
+
164
+
```css
165
+
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
166
+
.lib-main-navigation();
167
+
}
168
+
169
+
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
Copy file name to clipboardExpand all lines: guides/v2.1/frontend-dev-guide/responsive-web-design/rwd_css.md
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,9 @@ The Blank and Luma theme styles are based on the [Magento UI library]. The libra
44
44
45
45
The approach implemented in the Magento UI library, uses `@media-common` style group separation and `.media-width()` mixins which can be used in any `.less` file in a theme, as many times as needed, but it is invoked only once, in `lib/web/css/source/lib/_responsive.less`. The resulting `styles-m.css` and `styles-l.css` both have only one call of each media query with all the rules there, instead of multiple calls for the same query.
46
46
47
+
- Media queries `@media-common`, `max screen__s` and `max screen__m` will be added to `styles-m.css`.
48
+
- Media queries `min screen__m` and `min screen__l` will be added to `styles-l.css`.
49
+
47
50
If working on a theme which inherits from either the Blank or Luma theme, it's recommended to use `.media-width()` and style groups separation. Otherwise the style rules will be added twice, once to `styles-m.css` and once more to `styles-l.css`.
48
51
49
52
For Less styles rules to be compiled to `styles-m.css` without a media query so that they apply to all screen widths use the `@media-common` style group separation.
Copy file name to clipboardExpand all lines: guides/v2.1/frontend-dev-guide/themes/debug-theme.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -64,11 +64,11 @@ There is no straightforward algorithm how to define at once the exact layout fil
64
64
65
65
Example:
66
66
67
-
Let's say you need to locate the layout that is responsible for displaying mini shopping cart on the storefront, when the Blank theme by Magento is applied for the {% glossarytooltip ca5a9ff1-8182-4fc4-a34b-9b3f831dbf3f %}store view{% endglossarytooltip %}.
67
+
Say you need to locate the layout that is responsible for displaying mini shopping cart on the storefront, when the Blank theme by Magento is applied for the {% glossarytooltip ca5a9ff1-8182-4fc4-a34b-9b3f831dbf3f %}store view{% endglossarytooltip %}.
68
68
69
69
Using the Template Hints we determine that the template is `app/code/Magento/Checkout/view/frontend/templates/cart/minicart.phtml`, and in the path, we see that it belongs to the `Magento_Checkout` module.
70
70
71
-
Let's search for the layout following the fallback scheme:
71
+
Search for the layout following the fallback scheme:
72
72
73
73
1. Check the `app/design/frontend/Magento/blank/Magento_Checkout/` layout. To locate the required layout, search this directory for occurrences of the template name, " minicart.phtml ". No matching file is found, so we proceed to the next fallback level, which is the parent theme layouts.
74
74
2. We can find the info about parent theme in a theme configuration file `theme.xml`, the parent theme name is specified there in the `<parent></parent>` node. In the `app/design/frontend/Magento/blank/theme.xml` there's no `<parent>` node, which means the Blank theme has no parents. So we should search on the next fallback level which is the module layouts.
@@ -78,8 +78,8 @@ After you located the necessary layout file, you can create your custom layout f
78
78
79
79
## Locate styles {#debug-theme-style}
80
80
81
-
To locate a CSS rule that is applied to a certain element, find the template for the page that contains the element. Or you can use browser debugging tools, to locate the class name.
82
-
After you find the class name, use text search in the theme and module styles directories to locate the `.less` or `.css` file that defines the class. Perform the search according to the following fallback scheme:
81
+
To locate a CSS rule that is applied to a certain element, find the template for the page that contains the element. Or use browser debugging tools to locate the class name.
82
+
After you find the class name, use text search in the theme and module styles directories to locate the `.less` or `.css` file that defines the class. Using the grunt tool makes it easy to locate the CSS path to the specific line number. Perform the search according to the following fallback scheme:
Copy file name to clipboardExpand all lines: guides/v2.2/frontend-dev-guide/css-topics/css_debug.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,7 @@ The following shows which Grunt tasks to use for debugging:
74
74
- After you switch the compilation mode from client-side to server-side, run the `exec` command.
75
75
- After you customize the content of any `.less` file, except the root source files, run the `less` task and reload the page.
76
76
- After you [customize the root source files or move the files included to the root files]({{ page.baseurl }}/frontend-dev-guide/css-topics/css-preprocess.html#css_exception), run the `exec`command and reload the page.
77
+
- After you run `php bin/magento setup:upgrade`, run `exec` command.
77
78
- After you run the `exec` command, run the `clear`command to `clear` the Magento cache, then run the `watch` command. Running the commands in this order will ensure that any custom jQuery attributes like product sliders, banners, etc are loaded correctly.
78
79
79
80
If you have LiveReload installed, run the `grunt watch` command, and the flow is even simpler:
Copy file name to clipboardExpand all lines: guides/v2.2/frontend-dev-guide/layouts/layout-overview.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ This article describes the basic concepts you need to know to create layouts for
12
12
13
13
In Magento, the basic components of page design are layouts, containers, and blocks. A *layout* represents the structure of a web page (1). *Containers* represent the placeholders within that web page structure (2). And *blocks* represent the UI controls or components within the container placeholders (3). These terms are illustrated and defined below.
14
14
15
+
The objective is to create a structured, common set of layout instructions to render pages. Most pages on a website can be categorized as a 1 column, 2 column, or 3 column layout. These page layouts can applied to a page from within the admin panel.
16
+
15
17
![web page sample layout][layout]
16
18
17
19
(1) *Layouts* provide the structures for web pages using an XML file that identifies all the containers and blocks composing the page. The details of layout XML files are described later in this section.
0 commit comments