Adobe AD0-E720 Practice Test - Questions Answers, Page 3
List of questions
Question 21

Where are the Magento Ul library LESS files located?
This directory contains various LESS files that define variables, mixins, functions, and styles for common UI elements and components. The Magento_Ui/web/css/source and lib/web/css/source/lib directories are not valid and do not contain the Magento UI library LESS files.
Reference: [Magento UI library], [Magento UI library source files]
Question 22

An Adobe Commerce developer has found following code:
After compiling the .less file into a .ess file, what will be the results of the code above?
A)
B)
C)
After compiling the .less file into a .css file, the result of the code above will be option B. This is because the .less file uses a mixin called .animation() that takes two parameters: the name of the animation and the duration. The mixin defines a set of vendor-prefixed properties for the animation and assigns them the values of the parameters. For example:
.animation(@name; @duration) { -webkit-animation-name: @name; -webkit-animation-duration: @duration; -moz-animation-name: @name; -moz-animation-duration: @duration; animation-name: @name; animation-duration: @duration; }
When the mixin is called with the values ''fade'' and ''2s'', it will generate the following CSS code:
-webkit-animation-name: fade; -webkit-animation-duration: 2s; -moz-animation-name: fade; -moz-animation-duration: 2s; animation-name: fade; animation-duration: 2s;
Option A is not correct because it does not use the vendor prefixes for the animation properties. Option C is not correct because it uses the wrong values for the animation name and duration.
Reference: [LESS Mixins], [CSS Animations]
Question 23

An Adobe Commerce developer is extending a theme from Magento\blank and wants to override parent styles. Which file does the developer need to change to override the parent theme styles?
To override the parent theme styles, the developer needs to change the web/css/source/_extend.less file in the child theme. This file is used to import and extend the parent theme styles without modifying the original files. The developer can use the @import directive to import the parent theme styles and then use the .lib-css() mixin to override the CSS properties. For example:
@import 'source/_extend.less'; // Import parent theme styles .lib-css(color, red); // Override color property
The web/css/source/_extends.less and web/css/source/_theme.less files are not valid and will not work, as they do not follow the theme structure or the naming convention.
Reference: [Theme inheritance], [Extend parent theme styles]
Question 24

An Adobe Commerce developer has been asked to implement a custom font specifically for emails. The Adobe Commerce developer has already added their font into the file system.
Keeping best practice in mind, which two files would need to be implemented to show the custom font in the email?
To implement a custom font specifically for emails, the developer needs to do the following steps:
Add the custom font file to the web/fonts directory of the custom theme.
Use the @import font function with the url of the custom font from the theme in the /Vendor/Theme/web/css/source/_extend.less file. This will import the custom font and make it available for use in other LESS files. For example:
@import font('custom-font', '@{baseDir}fonts/custom-font.ttf', 'truetype');
Add in the styles to target the elements that require being changed in the /Vendor/Theme/web/css/source/_email.less file. This file is used to define the styles for email templates. The developer can use the .lib-font-face() mixin to apply the custom font to specific selectors. For example:
.lib-font-face( @family-name: @custom-font, @font-path: '@{baseDir}fonts/custom-font', @font-weight: normal, @font-style: normal );
h1 { .lib-font-face( @family-name: @custom-font, @font-path: '@{baseDir}fonts/custom-font', @font-weight: normal, @font-style: normal ); }
The /vendor/Theme/web/css/source/_typography.less file is not suitable for implementing a custom font for emails, as it is used for defining global typography styles for web pages. The <head></head> tag is not used for adding fonts in email templates, as it is not supported by most email clients.
Reference: [Custom fonts], [Email templates overview]
Question 25

An Adobe Commerce developer is customizing buttons for a custom theme that inherits Magento/blank theme and needs to override the default values. Where would the default values for the buttons be located?
To find the default values for the buttons, the developer needs to look at the lib/web/css/source/lib/_buttons.less file. This file contains various variables, mixins, and styles for defining and customizing buttons. The developer can override these values in their custom theme by using the .lib-button() mixin or by creating their own mixins or classes. For example:
.lib-button( @_button-selector, @_button-type, @_button-shape, @_button-color, @_button-background, @_button-border, @_button-text-transform, @_button-box-shadow, @_button-hover-color, @_button-hover-background, @_button-hover-border, @_button-hover-box-shadow );
The lib/web/less/source/lib/_buttons.less and lib/web/css/source/lib/_button.less files are not valid and do not exist.
Reference: [Buttons], [Magento UI library]
Question 26

an Adobe commerce developer wants to override the core Magento Ul library dropdowns in your theme. Which is the correct way to achieve this?
To override the core Magento UI library dropdowns in a custom theme, the developer needs to create a file named _dropdowns.less in the /web/css/source directory of the theme. This file will override the default _dropdowns.less file from the lib/web/css/source/lib directory and apply the custom styles to the dropdown elements. The lib/web/css/source/_dropdowns.less and /web/css/source/lib/_dropdowns.less files are not valid and will not work, as they do not follow the theme structure or the naming convention.
Reference: [Dropdowns], [Theme structure]
Question 27

What is the difference between styles-l.less and styles-m.less ?
The styles-l.less and styles-m.less files are two main LESS files that are used to generate CSS files for different devices and screen sizes. The styles-l.less file is used to generate styles-l.css, which contains desktop-specific styles that are applied only when the screen width is greater than 768px. The styles-m.less file is used to generate styles-m.css, which contains basic and mobile-specific styles that are applied for all devices and screen sizes. The other options are not correct and do not reflect the purpose of these files.
Reference: [Stylesheets], [Responsive web design]
Question 28

In which mode would the stylesheet customizations display immediately after you reload a page in a browser?
In client-side compilation mode, the stylesheet customizations will display immediately after reloading a page in a browser. This is because in this mode, the LESS files are compiled into CSS files by the browser using JavaScript. This mode is useful for development and debugging purposes, as it allows quick changes and previews of the styles. However, this mode is not recommended for production, as it can affect the performance and compatibility of the site. The other modes, server-side compilation and LESS compilation, require running commands or tools to compile the LESS files into CSS files on the server side, which can take some time and delay the display of the customizations.
Reference: [Compilation modes], [Compile LESS]
Question 29

An Adobe Commerce developer wants to add a custom widget that extends the default Calendar Widget. What would the contents of this file look like?
A)
B)
C)
To add a custom widget that extends the default Calendar Widget, the contents of the file would look like option B. This is because option B follows the correct syntax and structure for defining a jQuery widget in Magento. The code does the following steps:
Defines a module with the name ''Vendor_Module/js/calendar-widget'' that depends on the ''jquery/ui'' and ''Magento_Ui/js/lib/knockout/bindings/datepicker'' modules.
Returns a function that creates a new widget with the name ''vendor.calendarWidget'' that extends the base calendar widget class.
Overrides the init function of the base calendar widget class to add custom logic or functionality to the widget.
Option A is not correct because it does not use the correct syntax for defining a jQuery widget. It uses a script tag instead of a define function, which is not valid for creating a module. It also uses an incorrect name for the widget, which should use a dot instead of a slash. Option C is not correct because it does not use the correct syntax for extending a widget. It uses an extend function instead of a widget function, which is not valid for creating a new widget. It also does not return anything from the module, which will cause an error.
Reference: [jQuery widgets], [Calendar Widget]
Question 30

An Adobe Commerce developer wants to apply a knockout binding to a to run a function, onClick(), when it's clicked. Which two solutions would the developer use to achieve this? (Choose two.)
Question