Meblya

Thank you for purchasing my theme. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

Features

  • 100% Responsive Layout
  • LTR/RTL version
  • HTML5 and CSS3
  • Bootstrap 4
  • SASS
  • CSS3 Animation
  • SVG Icons
  • Font Awesome Icons
  • BEM syntax
  • Open Sans Google Font
  • Compatible with all major browsers
  • Grid / list products view
  • Photoswipe gallery

Getting Started

There are two ways to start using the Meblya template:

  • The first way is to use pre-compiled HTML files. The description of this method is below;
  • The second way is to build a template from sources, it is suitable for experienced developers (See the section Sources).

Pre-compiled HTML

After downloading and unpacking the Meblya template, pre-compiled HTML files will be located in the HTML directory.

So, the HTML directory will look like after unpacking:

HTML/
    classic/
    dark/

This directory contains different versions of the template:

  • classic - standard version;
  • dark - version with dark header and footer.

Choose the one you want to use (for example classic):

HTML/
    classic/
        css/
        images/
        js/
        vendor/
        404.html
        about-us.html
        account.html
        blog.html
        ...

Description of HTML Structure, CSS Files and Javascript files are in the relevant sections.

If you want to add images or make changes to CSS or Javascript files, you need to open the corresponding files.

Please note that any errors or broken layouts that result from you editing the CSS or JavaScript files are not covered by support. Edit these files at your own risk.

To continue customizing the template, go to the "Customization" section.

HTML Structure

This template based on a responsive layout. All of the information within the main content area is nested within a body tag. The general template structure is the same throughout the template. Here is the general structure.

<body>
    <!-- mobilemenu -->
    <div class="mobilemenu">
        ...
    </div>
    <!-- mobilemenu / end -->

    <!-- site -->
    <div class="site">
        <!-- site__header -->
        <header class="site__header">
            ...
        </header>
        <!-- site__header / end -->

        <!-- site__body -->
        <div class="site__body">
            ...
        </div>
        <!-- site__body / end -->

        <!-- site__footer -->
        <footer class="site__footer">
            ...
        </footer>
        <!-- site__footer / end -->
    </div>
    <!-- site / end -->

    <!-- photoswipe -->
    <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
        ...
    </div>
    <!-- photoswipe / end -->
</body>

CSS Files

This template uses six css files:

  • css/style.css
    Contains main stylesheets. css/style.ltr.css - same as css/style.css but only contains styles for LTR direction.
    css/style.rtl.css - same as css/style.css but only contains styles for RTL direction.
  • vendor/bootstrap/css/bootstrap.min.css
    Bootstrap is an open source toolkit for developing with HTML, CSS, and JS.
  • vendor/owl-carousel/assets/owl.carousel.min.css
    Touch enabled jQuery plugin that lets you create a beautiful responsive carousel slider. Used for home page slider, products carousel, posts carousel, etc.
  • vendor/photoswipe/photoswipe.css
    vendor/photoswipe/default-skin/default-skin.css
    JavaScript image gallery for mobile and desktop, modular, framework independent. Used on the product page in the product gallery.
  • vendor/fontawesome/css/all.min.css
    This CSS file is required for Icon Font.

style.css

At the very beginning of the css/style.css file you will find a table of contents that you can use to quickly navigate through the file.

Here is an example of the structure of the style.css:

/* ----------------------------------------

Table of content:

- Components:
  - alert
  - breadcrumb
  - button-remove
  ...
- Common:
  ...
- Blog:
  ...
- Shop:
  ...
- Blocks:
  ...
- Widgets:
  ...
- Filters:
  ...
- Header:
  ...
- Footer:
  ...

---------------------------------------- */

/* ----------------------------------------
// Components
// ---------------------------------------- */
/*
 * alert
 */

    ...

/*
 * breadcrumb
 */

    ...

/*
 * button-remove
 */

    ...

/* ----------------------------------------
// Common
// ---------------------------------------- */

    ...

Javascript

This template uses seven javascript files:

  • js/main.js
    This file contains all javascript code related to theme.
  • vendor/jquery/jquery.js
    jQuery is a Javascript library that greatly reduces the amount of code that you must write.
  • vendor/nouislider/nouislider.js
    Lightweight JavaScript range slider with full touch support.
  • vendor/owl-carousel/owl.carousel.js
    Touch enabled jQuery plugin that lets you create a beautiful responsive carousel slider.
  • vendor/svg4everybody/svg4everybody.min.js
    SVG for Everybody adds SVG External Content support to all browsers.
  • vendor/photoswipe/photoswipe.min.js
    vendor/photoswipe/photoswipe-ui-default.min.js
    JavaScript image gallery for mobile and desktop, modular, framework independent. Used on the product page in the product gallery.

Fonts

We used two fonts in this template:

Sources

Attention! This section is for advanced users.

Template source codes are in the Sources directory. After downloading and unpacking the template, the Sources directory will look like this:

Sources/
   gulp/
      tasks.js
   src/
      ...
   gulpfile.js
   package.json
   package-lock.json

Preparation

  1. Make sure your system has installed Node.js.
  2. Open a terminal window and go to the Source directory.
  3. Run the npm install command. This command will load all necessary dependencies specified in the package.json file.

To build the project run the command:

./node_modules/.bin/gulp build

Or (if gulp is installed globally):

gulp build

After executing the command, the compiled template will be located in the dist directory.

For a complete list of available commands, see the Gulp Tasks section below.

Gulp Tasks

Gulp tasks are in the gulp/tasks.js and gulpfile.js files. Unfortunately, such a bit of unusual structure is necessary for us to automatically build the package for themeforest.

Gulp tasks description:

  • twig - Compiles twig templates into html pages.
  • scss - Compiles scss to css/style.css file.
  • vendor - Copies the contents of the src/vendor directory to the dist/vendor directory.
  • images - Copies the contents of the src/images directory to the dist/images directory.
  • svg - Creates SVG sprite (sprite.svg) from svg files and save it to the dist/images directory.
  • js - Copies the contents of the src/js directory to the dist/js directory.
  • serve - Runs a local http server and the template build process with change tracking.
  • watch - Runs the template build process with change tracking.
  • build - Builds a template.

Twig templates

We used twig.js as a template engine (this is a port of the popular PHP library for javascript). Documentation on its syntax can be found on the official site.

Data for templates

Each file from the Sources/src/data directory is projected into the global namespace. The variable name is the file name without the extension. For example, we have the file Sources/src/data/theme.json with the following contents:

{
    "name": "Meblya"
}

Now, to display the name of the theme in the template, we can use the following construction {{ theme.name }}.

Pay attention to the fact that all files must be in json format, and their names must match the regular expression /^[_A-Za-z0-9]+\.json$/.

Template directories

The directory with the templates (Sources/src/twig) is divided into the following subdirectories:

  • blocks - Independent parts that can be used on different pages.
  • footer - Template files associated with the site footer.
  • header - Template files associated with the site header.
  • layouts - In this directory is the base layout used by all pages.
  • pages - These are the main template files that are directly compiles into html page files.
  • partials - Other parts not included in any other directory.
  • widgets - Component parts of blocks (usually they are used in the sidebar).

SCSS Files

The directory with SCSS files contains the following files and subdirectories:

scss/
   blocks/
   blog/
   common/
   components/
   filters/
   footer/
   header/
   mixins/
   shop/
   widgets/
   _custom.scss
   _custom-variables.scss
   _dark-theme.scss
   _functions.scss
   _mixins.scss
   _variables.scss
   style.ltr.scss
   style.rtl.scss
   style.scss

You can make changes to any of these files.

To make it easier for you in the future to upgrade the template to the new version, we recommend (if possible) making changes only to _custom-variables.scss and _custom.scss files.

  • _custom-variables.scss - It is used to override the values of variables.
  • _custom.scss - Use to write your own scss code.

Dark header and footer

To enable dark header and footer, open the _custom-variables.scss file, then find and uncomment following line:

//@import 'dark-theme';

After that, you need to rebuild the template using the gulp build command.

How does LTR/RTL support work?

The direction is controlled using two scss variables:

  • $direction - indicates direction. Possible values: ltr or rtl.
  • $both-directions - if true compiles styles for two directions, the $direction variable will be ignored. Possible values: true or false.

Some "magic" variables are also used, which change their value depending on the given direction value. The names of these variables are the same as the names of the Logical Properties (for example, variable $margin-inline-start). These variables should only be used in the direction mixin.

This example demonstrates how it works:

.alert {
    @include direction {
        #{$margin-inline-start}: 20px;
    }
}

Will be compiled to:

  • If $direction == ltr and $both-directions == false:
    .alert {
        margin-left: 20px;
    }
  • If $direction == rtl and $both-directions == false:
    .alert {
        margin-right: 20px;
    }
  • If $both-directions == true:
    [dir=ltr] .alert {
        margin-left: 20px;
    }
    [dir=rtl] .alert {
        margin-right: 20px;
    }

What if you want to use only one direction?

Open src/scss/_custom-variables.scss, and define next variables:

$direction:       ltr;   // specify the direction you need (ltr or rtl)
$both-directions: false; // set to false to disable style compilation
                         // for two directions

Customization

Table of content

  • How to change the logo?
  • How to change the font?
  • How to remove/change copyright notice?
  • How to change direction (LTR <-> RTL)?

How to change the logo?

If you are working with HTML files:

In HTML files, find comments <!-- logo --> and <!-- logo / end --> and replace code between them with your logo image.


If you are working with source code:

  1. Open the src/twig/header/header.twig file.
  2. Find comments <!-- logo --> and <!-- logo / end --> and replace code between them with your logo image.

How to change the font?

If you are working with HTML files:

  1. In HTML files find and replace with the desired font:
    <!-- fonts -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,600i,700,700i">
  2. Open the css/style.css file.
  3. Insert at the end:
    body {
       font-family: "YOUR_FONT_NAME";
    }

If you are working with source code:

  1. Open the src/twig/layouts/basic.twig file.
  2. Find and replace with the desired font:
    <!-- fonts -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,600i,700,700i">
  3. Open the src/scss/_custom-variables.scss file.
  4. And define a special variable, as in the example below:
    $body-font-family: 'YOUR_FONT_NAME';

How to remove/change copyright notice?

If you are working with HTML files:

In HTML files, find comments <!-- copyright --> and <!-- copyright / end -->, then replace code between them with your copyright.


If you are working with source code:

  1. Open the src/twig/footer/footer.twig file.
  2. Find comments <!-- copyright --> and <!-- copyright / end -->, then replace code between them with your copyright.

How to change direction (LTR <-> RTL)?

If you are working with HTML files:

  1. Open HTML/{THEME_NAME}/{*}.html (for example HTML/classic/index.html);
  2. And specify value of the dir attribute (ltr or rtl) for <html> tag, for example:
    <!DOCTYPE html>
    <html lang="en" dir="rtl">
    ...
    By default, style.css is used in template files, it contains styles for both directions. If you want to use one direction, you can replace it with a more efficient version style.{direction}.css.
  3. Find: <link rel="stylesheet" href="css/style.css">.
    And replace to: <link rel="stylesheet" href="css/style.rtl.css">

If you are working with source code:

Described in the "Sources" section.

Changelog

Version 1.3.0 – January 18, 2022

  • Updated: jQuery from 3.4.1 to 3.6.0;
  • Updated: Bootstrap from 4.4.1 to 5.1.3 and other dependencies;
  • Other: Replace node-sass with dart-sass.

Version 1.2.0 – March 11, 2020

  • Added: RTL support;
  • Added: PhotoSwipe gallery on the product page;
  • Added: Customization section to the documentation;
  • Changed: Scripts moved to the end of page;
  • Updated: Bootstrap from 4.3.1 to 4.4.1;
  • Updated: jQuery from 3.3.1 to 3.4.1;
  • Updated: noUiSlider from 13.1.4 to 14.1.1;
  • Updated: Font Awesome from 5.8.1 to 5.12.1;
  • Other: Now instead of black images of stubs, more friendly gray images with an image resolution printed on them are used.

Version 1.1.0 – March 29, 2019

  • Updated Bootstrap from 4.1.3 to 4.3.1;
  • Updated Font Awesome from 5.6.1 to 5.8.1;
  • Updated noUiSlider from 12.1.0 to 13.1.4.

Version 1.0.0 – January 20, 2019

  • Initial Release.

Known Issues

SVG icons are not displayed when opening HTML files in a browser

When loading pages via file:// URI, due to the security policy, browsers block the loading of external SVG icons because they have a unique origin. To fix this, you need to open HTML files using the HTTP/HTTPS protocol. To do this, launch a local HTTP server or upload files to a remote server.

Credits