# __PROJECTNAME__ Theme (Sass)

This is a modified lightweight Sass port of Magento 2 child theme.
It depends on
* ctidigital/magesparrow-blank (port of magento2 blank theme)

# Theme MageSparrow Tasks (With Multi-site Support)
-------------

### Background
This is used by the Magento 2 project scaffold script to create NPM (Node) tasks for a new theme as part of a project setup. 

This can also be used standalone (Download/copy) to compile any Magento 2 Theme as long as Sass files are present.
This task expects to provide a import path for `LibMagesparrow` Sass library, when used for standalone purposes.

Please do not commit into this repository any project related changes.

### Getting Started
```sh
cd vendor/ctidigital/magesparrow-tasks
```

```sh
nvm install && nvm use
```

```sh
npm install --global gulp-cli
```

```sh
npm install
```

### Usage

Development build
```sh
npm run dev 
```

Production build
```sh
npm run prod 
```

BrowserSync Development
```sh
npm run serve 
```

Compile a specific theme
<THEME_NAME> - must be same as the prefix on sites application.yaml
```sh
npm run build --magesparrow-tasks:theme=<THEME_NAME>
```

### Recommendations

Below recommendations will optimise the local vm to load quicker on local development environments.

1. [Make Redis to accept host connections](https://confluence.ctidigital.com/x/dRYXAg)

2. [Make Varnish accept host connections](https://confluence.ctidigital.com/x/ZhcXAg)

3. [Avoid SSL Certificate Error (in browser) for BrowserSync](https://confluence.ctidigital.com/x/YhYXAg)

4. [Avoid SSL Certificate Error (in browser) for VM domain](https://confluence.ctidigital.com/x/axYXAg)

5. [Upgrade Nginx to allow OpenSSL to support HTTP2 ALPN for Ubuntu 14.04](https://confluence.ctidigital.com/x/cBYXAg)


## Import Blank theme variables

If you would like to import Blank theme Sass variables, please include them by adding the import statements as below.

```
//------------------------------------//
// Magesparrow - Theme Settings       //
//-----------------------------------//
// Do not remove this.
@import "magesparrow-theme";
//-----------------------------------//
```

To include it within Magento Module folders use the command below

```
//------------------------------------//
// Magesparrow - Theme Settings       //
//-----------------------------------//
// Do not remove this.
@import "../../../web/css/magesparrow-theme";
//-----------------------------------//
```


## Import Blank theme styles

If you would like to import Blank theme Sass style definitions, please include them by adding the import statements as below.

```
//------------------------------------//
// Magesparrow - Blank Theme styles   //
//------------------------------------//
// Do not remove this.
@import "web/css/theme";
//------------------------------------//
```

To include it with Magento Module folders use the command below
```
//------------------------------------//
// Magesparrow - Blank Theme styles   //
//------------------------------------//
// Do not remove this.
@import "<Vendor_ModuleName>/web/css/module";
//------------------------------------//
```
