-
Loki Checkout
- User documentation
-
Developer documentation
- Modules
- Getting started
- Architecture
- Basic customizations
- Advanced customizations
- Integrations
-
Troubleshooting
- Common errors
- Disabling Loki Checkout
- Troubleshooting tips
- Troubleshooting JS validation
- Troubleshooting Luma styling
- Where are my TailwindCSS classes?
- Email validation issues
- Button of final step is loading forever
- ZIP code validation seems to tight
- Specific field is required
- Custom component skips step validation
- Troubleshooting the layout
- "Street Address" cannot contain more than 2 lines
- Invalid city
- ADR
- Playbook
- Reference
- Milestones and roadmap
- Module overview
- Frequently Asked Questions
- Loki Components
- Loki Field Components
- Loki Admin Components
- Loki Theme Kit
- Loki Base
- Miscellaneous
Where are my TailwindCSS classes?
Usually, TailwindCSS classes are added to the right HTML element via PHTML templates. However, our aim is that this is always done with the $css() utility as well.
Bad example:
<div class="grid grid-cols-2"></div>
Good example:
<div class="<?= $css('grid grid-cols-2') ?>"></div>
While this adds a lot of flexibility, it also makes analysing the source of TailwindCSS classes a bit harder. To analyse where TailwindCSS classes originate from when they are added to a specific block output, take the following steps:
-
Scan the PHTML template. This is what you probably already have done, but it is simple step 1.
-
Scan the XML layout for your specific block
namewith the argumentcss_classarray set. -
Scan the XML layout for blocks that allow to define defaults for other blocks. For instance, the
loki-components.css_classesblock can be used to redefine CSS classes of any block. And the same applies toloki-components.defaults.form.fieldwhen it comes tofield.phtmltemplates. -
Finally, even though it is a bit hard-code, use Xdebug (or some other means of debugging) on the
getCssClasses()of the componentsViewModelclass.