If you need add class to top.links block use layouts like
<referenceBlock name="top.links">
<arguments>
<argument name="css_class" xsi:type="string">my-class</argument>
</arguments>
</referenceBlock>
if you need add new link to top.links use layout like
<referenceBlock name="top.links">
<block class="\Magento\Framework\View\Element\Html\Link" name="top-link-myaccount">
<arguments>
<argument name="label" xsi:type="string">My Account</argument>
<argument name="href" xsi:type="url">customer/getAccountUrl</argument>
<argument name="class" xsi:type="string">top-link-myaccount</argument>
</arguments>
</block>
</referenceBlock>
Open
Magento/Checkout/view/frontend/layout/checkout_index_index.xml
file. look at following line
<item name="component" xsi:type="string">Magento_Checkout/js/view/shipping</item>
So
Magento/Checkout/view/frontend/web/js/view/shipping.js
this is your js file. Open it. Look
template: 'Magento_Checkout/shipping'
this is the template file for this JS.
Go back to
Magento/Checkout/view/frontend/layout/checkout_index_index.xml
line 122 (M2 2.0.0-rc)
<item name="children" xsi:type="array">
here you can see some child node. like
<item name="customer-email" xsi:type="array">
----
---
</item>
So
getTemplate()
is responsible for current template rendering that means
Magento/Checkout/view/frontend/web/template/form/element/email.html
Open it, then you can see following code snippet
<!-- ko foreach: getRegion('additional-login-form-fields') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
this 'additional-login-form-fields' node is the child node of 'customer-email' .
For your code snippet, if quote is not virtual then pick ko
foreach: getRegion('customer-email')
which is child node name and render its template.
Best Answer
Magento adding that class for body using below class Magento\Framework\View\Result\Page.php
It is work same like you are adding for body
Output: http://easycaptures.com/3327274226