In Magento 2, there is a term called static content deployment. You see js/css files links coming from pub/static/
directory because Magento deploys js/css
files to this directory from your theme/module
directory and whenever a user visits website, static files and referred/shown from pub/static/ directory.
Initially you will be developing your frontend theme in app/design/frontend/
and you can deploy static content to pub/static/frontend/
using command php bin/magento setup:static-content:deploy
. During development you should delete everything inside pub/static/
, var/cache/
, var/page_cache/
, var/generation/
and deploy you content using above command.
Here is basic theme configuration example which goes inside app/design/frontend/MyStore/MyAbstract/
theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Mystore</title>
<parent>Magento/blank</parent>
<media>
<preview_image>media/preview.jpg</preview_image>
</media>
</theme>
registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/MyStore/MyAbstract',
__DIR__
);
Put preview image preview.jpg (you can change name is theme.xml) inside media directory and you should see your theme in admin section store configuration.