Commit 9a8ebff2 authored by Administrator's avatar Administrator 💬

Let's fool around with git-sync!

parent f149fcc1
Pipeline #26 passed with stage
in 1 minute and 34 seconds
{
"env": {
"browser": true,
"node": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"
},
"rules": {
"accessor-pairs": 2,
"array-bracket-spacing": 0,
"block-scoped-var": 0,
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"camelcase": 0,
"comma-dangle": [2, "never"],
"comma-spacing": [2, { "before": false, "after": true }],
"comma-style": [2, "last"],
"complexity": 0,
"computed-property-spacing": 0,
"consistent-return": 0,
"consistent-this": 0,
"constructor-super": 2,
"curly": [2, "multi-line"],
"default-case": 0,
"dot-location": [2, "property"],
"dot-notation": 0,
"eol-last": 2,
"eqeqeq": [2, "allow-null"],
"func-names": 0,
"func-style": 0,
"generator-star-spacing": [2, { "before": true, "after": true }],
"guard-for-in": 0,
"handle-callback-err": [2, "^(err|error)$" ],
"indent": [2, 4, { "SwitchCase": 1 }],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"linebreak-style": 0,
"lines-around-comment": 0,
"max-nested-callbacks": 0,
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
"new-parens": 2,
"newline-after-var": 0,
"no-alert": 0,
"no-array-constructor": 2,
"no-caller": 2,
"no-catch-shadow": 0,
"no-cond-assign": 2,
"no-console": 0,
"no-constant-condition": 0,
"no-continue": 0,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-div-regex": 0,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-else-return": 0,
"no-empty": 0,
"no-empty-character-class": 2,
"no-eq-null": 0,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": 0,
"no-extra-semi": 0,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inline-comments": 0,
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-lonely-if": 0,
"no-loop-func": 0,
"no-mixed-requires": 0,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [2, { "max": 1 }],
"no-native-reassign": 2,
"no-negated-in-lhs": 2,
"no-nested-ternary": 0,
"no-new": 2,
"no-new-func": 0,
"no-new-object": 2,
"no-new-require": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-param-reassign": 0,
"no-path-concat": 0,
"no-process-env": 0,
"no-process-exit": 0,
"no-proto": 0,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-restricted-modules": 0,
"no-return-assign": 2,
"no-script-url": 0,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow": 0,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-sparse-arrays": 2,
"no-sync": 0,
"no-ternary": 0,
"no-this-before-super": 2,
"no-throw-literal": 2,
"no-trailing-spaces": 2,
"no-undef": 2,
"no-undef-init": 2,
"no-undefined": 0,
"no-underscore-dangle": 0,
"no-unexpected-multiline": 2,
"no-unneeded-ternary": 2,
"no-unreachable": 2,
"no-unused-expressions": 0,
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
"no-use-before-define": 0,
"no-var": 0,
"no-void": 0,
"no-warning-comments": 0,
"no-with": 2,
"object-curly-spacing": 0,
"object-shorthand": 0,
"one-var": [2, { "initialized": "never" }],
"operator-assignment": 0,
"operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],
"padded-blocks": 0,
"prefer-const": 0,
"quote-props": 0,
"quotes": [2, "single", "avoid-escape"],
"radix": 2,
"semi": [2, "always"],
"semi-spacing": 0,
"sort-vars": 0,
"keyword-spacing": [2, {"after": true, "overrides": {"throw": { "after": true}, "return": { "before": true }}}],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [2, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!"] }],
"strict": 0,
"use-isnan": 2,
"valid-jsdoc": 0,
"valid-typeof": 2,
"vars-on-top": 0,
"wrap-iife": [2, "any"],
"wrap-regex": 0,
"yoda": [2, "never"]
}
}
node_modules
*.js.map
*.css.map
/.idea
# v2.0.3
## 03/07/2019
1. [](#bugifx)
* Properly fallback to config message if not there yet (#134)
# v2.0.2
## 02/21/2019
1. [](#improved)
* Fixed InitCommand spelling (#132, thanks @alex-mohemian)
1. [](#bugfix)
* Fixed PHP 5.6 incompatibility introduced by latest release.
# v2.0.1
## 02/19/2019
1. [](#new)
* Added new `init` CLI command (`bin/plugin git-sync init`) (#128, thanks @LeonRyan and @alex-mohemian)
1. [](#improved)
* Allow setting a personalised commit message (#123, thanks @kyed)
* Added better directions for Azure + IIS users for the Git Binary
1. [](#bugfix)
* Fixed `LC_ALL` to use `C` instead of en_US.UTF-8`, to be more flexible (#124, #125, thanks @lambopedia)
# v2.0.0
## 10/15/2018
1. [](#new)
* Added support for new awesome Grav 1.6 Scheduler
* Added logic to display custom nested folders in wizard
* Other than `pages`, it is now possible to enable `config`, `data`, `plugins` and `themes` for synchronization. You can also add any custom folder you have in your `user` (#4, #21, #34, #58, #63, #83)
* Allow users with `admin.pages` permissions to synchronize through quick tray (#79, thanks @apfrod)
* When using Grav as committer, the user email will be now used for the commit (#81, thanks @apfrod)
* Added support for Webhook Secret (Bitbucket does not yet support them) (#72, #73, thanks @pathmissing)
* Added options to turn automatic synchronization on/off with page saves, delete and media changes (#105, thanks @AmauryCarrade)
1. [](#improved)
* Fixed alignment of the git icon in the Wizard (#115)
* Prevent Wizard modal to get canceled when clicking on the overlay background (#115)
* Quick tray icon is now smarter. If GitSync has not been initialized yet, it will take you straight to wizard, otherwise it would perform a synchronization (#115)
* Rearranged blueprint order (thanks @paulhibbitts)
* GitLab: Updated wizard instructions to be inline with the new GitLab UI (#90)
* Tweaked alignment of links in the wizard (#57)
* Properly support local branches that aren't `master` (#56)
* Allow to specify custom local_repository (default, `USER_DIR`) (#95, thanks @Hydraner, also #54, #33, #25)
* Webhook URL is now more robust and secure, by default it is generated with a random value
* Git icon from Admin has been replaced to use the `git` text icon instead of the logo
* Prevent next step if Step 1 and Step 2 are not filled in (#92)
* Added notice in Step 2 explaning what GitSync expect from the repository structure (#92)
1. [](#bugfix)
* Fixed issue where on first initialization the checkout process would error out
* Fixed issue with Pages save.
* Fixed JS error in plugins list
* Fixed nested folders not synchronizing
* Fixed issue where Wizard wouldn't work in case the `admin` path was modified (#27, #94, #77, thanks @pathmissing)
* Fixed webhook generated URL when multi-lang active (#71)
* Resolved issue with untracked/uncommited files at the root of the `sync` folder. (#101, thanks @ScottHamper)
# v1.0.4
## 08/16/2017
1. [](#new)
* CLI: Added `status` command to check config and git (#52, thanks @karfau)
* Allow local branches to be named differently than the remote branches (#48, thanks @denniswebb)
* Added support for new Admin Navigation Tray
1. [](#bugfix)
* Fixed minimum Git required version to support `--all` (#32,#49, thanks @redrohX)
# v1.0.3
## 02/21/2017
1. [](#bugfix)
* Fixed issue with new 'author' option that could trigger errors when settings were not saved. (#23)
* Fixed the 'More Details' button triggering the Modal to close instead of just expanding the details
# v1.0.2
## 02/18/2017
1. [](#new)
* It is now possible to change the committer name. You can choose between Git User, GitSync Committer Name, Grav User Name, Grav User Fullname (#14).
2. [](#improved)
* Added more documentation and description about the support of 2FA and Access Tokens (#16, #19, thanks @OleVik)
* Added 4th Generic Git choice in the wizard for self-hosted and custom git services (Gogs/Gitea) (#7 - #22 - thanks @erlepereira)
1. [](#bugfix)
* Fixed issue preventing the custom Git Binary Path from getting used (#15)
* Fixed issue with Webhook auto-generated URL where it would display double slashes in case of root domain (#15)
* Fixed issue with the modal not properly restoring the tutorial steps of the active selected service
# v1.0.1
## 01/29/2017
1. [](#bugfix)
* Changed default GitSync email for commits
# v1.0.0
## 01/25/2017
1. [](#new)
* Released plugin to stable GPM channel
# v1.0.0-rc.3
## 01/19/2017
1. [](#new)
* Added logger setting to log Git command executions
1. [](#improved)
* Improved Windows compatibility
# v1.0.0-rc.2
## 01/16/2017
1. [](#new)
* Allow to change the path for the `git` binary (#1)
* Added CLI for synchronizing `bin/plugin git-sync sync` (#2)
* More security: Git password will now get encrypted and won't load in admin
1. [](#improved)
* Wizard: Improved Bitbucket explanation about stripping out `user@` from the copied HTTPS url (#3)
1. [](#bugfix)
* Fixed potential issue when retrieving the currently installed git version
* Fixed issue that would not properly hide the password from error messages if the password contained special chars
* Fixed issue preventing the plugin to properly get setup the very first time and causing 401 error (#4)
* Workaround for error thrown when removing the plugin
# v1.0.0-rc.1
## 12/19/2016
1. [](#new)
* Initial Release
This diff is collapsed.
![](images/gitsync-logo.png)
**Git Sync** is a Plugin for [Grav CMS](http://github.com/getgrav/grav) that allows to seamlessly synchronize a Git repository with your Grav site, and vice-versa.
Git Sync captures any change that you make on your site and instantly updates your git repository. In the same way, Git Sync supports _webhooks_, allowing to automatically synchronize your site if the repository changes.
Thanks to this powerful bi-directional flow, Git Sync can now turn your site into a collaborative environment where the source of truth is always your git repository and unlimited collaborators and sites can share and contribute to the same content.
## Videos: Setup and Demo
| Up and Running in 2 mins | 2-way Sync Demonstration |
| ------------ | ----------------- |
| [![Up and Running in 2 mins](https://img.youtube.com/vi/avcGP0FAzB8/0.jpg)](https://www.youtube.com/watch?v=avcGP0FAzB8) | [![2-way Sync Demonstration](https://img.youtube.com/vi/3fy78afacyw/0.jpg)](https://www.youtube.com/watch?v=3fy78afacyw) |
## Installation using the GPM (Grav Package Manager)
To install git-sync simply run this command from the Grav root folder
```
bin/gpm install git-sync
```
After having installed the plugin, make sure to go in the plugin settings in order to get the Wizard configuration started.
## Features
<img src="wizard.png" width="500" />
* Easy step-by-step Wizard setup will guide you through a detailed process for setting things up
* Supported hosting services: [GitHub](https://github.com), [BitBucket](https://bitbucket.org), [GitLab](https://gitlab.com) as well as any self-hosted and git service with webhooks support.
* Private repositories
* Synchronize any folder under `user` (pages, themes, config)
* 2FA (Two-Factor Authentication) and Access Token support
* Webhooks support allow for automatic synchronization from the Git Repository with secure Webhook URL auto-generated and support for Webhook Secret (when available)
* Automatically handles simple merges behind the scenes
* Easy one-click button to reset your local changes and restores it to the actual state of the git repository
* Easy one-click button to manually synchronize
* Support for Admin Quick Tray so you can synchronize from anywhere in Admin
* Ability to customize whether GitSync should synchronize upon save or just manually
* Customize the Committer Name, choose between Git User, GitSync Commiter Name, Grav User Name and Grav user Fullname
* With the built-in Form Process action `gitsync`, you can trigger the synchronization anytime someone submits a post.
* Any 3rd party plugin can integrate with Git Sync and trigger the synchronization through the `gitsync` event.
* Built-in CLI command to automate synchronizations
* Log any command performed by GitSync to ensure everything runs smoothly or debug potential issues
# Command Line Interface
Git Sync comes with a CLI that allows to run synchronizations right within your terminal. This feature is extremely useful in case you'd like to run an autonomous periodic crontab job to synchronize with your repository.
To execute the command simply run:
```bash
bin/plugin git-sync sync
```
# Requirements
In order for the plugin to work, the server needs to run `git` 1.7.1 and above.
The PHP `exec()` and `escapeshellarg()` functions are required to be enabled.
# Sponsored by
This plugin could not have been realized without the sponsorship of [Hibbitts Design](http://www.hibbittsdesign.org/blog/) and the development of [Trilby Media](http://trilby.media).
This diff is collapsed.
name: Git Sync
version: 2.0.3
description: Allows to synchronize portions of Grav with Git Repositories (GitHub, BitBucket, GitLab)
icon: git
author:
name: Trilby Media, LLC
email: hello@trilby.media
url: http://trilby.media
homepage: http://trilby.media
keywords: grav, plugin, git, sync, github, bitbucket, gitlab
issues: https://github.com/trilbymedia/grav-plugin-git-sync/issues
docs: https://github.com/trilbymedia/grav-plugin-git-sync
license: MIT
dependencies:
- { name: grav, version: '>=1.5.0' }
- { name: form, version: '>=2.16.3' }
form:
validation: strict
fields:
Basic:
type: section
title: Basic Settings
underline: true
enabled:
type: toggle
label: Plugin Status
highlight: 1
default: 0
options:
1: Enabled
0: Disabled
validate:
type: bool
folders:
type: select
multiple: true
label: Folders to Sync
classes: fancy
description: Removing folders after they have been synced may cause undesired results.
default:
- pages
options:
- pages
- themes
- plugins
- config
- data
selectize:
create: true
validate:
type: commalist
Sync:
type: section
title: Automatic Synchronization Settings
underline: true
SyncNotice:
type: spacer
markdown: true
text: |
! To improve the speed of saving pages you can disable automatic sync. Then, changes to a page will not be sent to the remote repository on every save. To sync your changes to the repository tap the GitSync button (<i class="fa fa-git"></i>) in the top left of the Administration Panel, or use the below Scheduler option to add the GitSync Syncronization Job to the Scheduler (<strong>Grav 1.6 required</strong>).
sync.on_save:
type: toggle
label: Sync on Page Save
help: Sync with the remote directory when a page is saved through the admin
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
sync.on_delete:
type: toggle
label: Sync on Page Delete
help: Sync with the remote directory when a page is deleted through the admin
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
sync.on_media:
type: toggle
label: Sync on Media Changes
help: Sync with the remote directory when a media is uploaded or deleted through the admin immediately (instead of only syncing when the page is saved)
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
sync.cron_enable:
type: toggle
label: Add Sync to Scheduler
help: Add GitSync Job to the Scheduler so it can automatically perform synchronization at the given time
default: 0
highlight: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
sync.cron_at:
type: cron
label: Run Sync at
help: When should the Scheduler run the automatic GitSync synchronization job
default: '0 12,23 * * *'
Repo:
type: section
title: Git Repository Settings
underline: true
local_repository:
type: hidden
multiple: false
size: medium
label: Local Repository Path
repository:
type: text
label: Git Repository
placeholder: https://github.com/user/repository.git
user:
type: text
label: Git User
placeholder: Username, not email
autocomplete: off
password:
type: enc-password
label: Git Password or Token
placeholder: Your Git Password or Token
description: Enter your password or token to encrypt and securely store it, then save the settings. It will not show up here for security reasons.
autocomplete: off
webhook:
type: text
label: Repository Web Hook URL
placeholder: /_git-sync
data-default@: '\Grav\Plugin\GitSyncPlugin::generateRandomWebhook'
webhook_enabled:
type: toggle
label: Web Hook Secret
highlight: 1
default: 0
options:
1: Enabled
0: Disabled
description: With this setting enabled, only authorized webhook calls will be able to trigger a synchronization (recommended)
webhook_secret:
type: text
label: Repository Web Hook Secret
placeholder: Your Web Hook Secret
data-default@: '\Grav\Plugin\GitSyncPlugin::generateWebhookSecret'
description: You can either use this randomly generated string or enter your own secret. <br /> **Bitbucket** does not yet support Webhook Secrets.
markdown: true
Advanced:
type: section
title: Advanced Git Settings
underline: true
branch:
type: text
default: master
label: Local Branch
placeholder: master
remote.name:
type: text
default: origin
label: Remote Name
placeholder: origin
remote.branch:
type: text
default: master
label: Remote Branch
placeholder: master
git.author:
type: select
default: gituser
label: Commits Author
options:
gituser: Use Git User Name
gitsync: Use GitSync Committer Name
gravuser: Use Grav User Name
gravfull: Use Grav User Full Name
git.message:
type: text
default: (Grav GitSync) Automatic Commit
label: Commit message
placeholder: (Grav GitSync) Automatic Commit
help: You can use {{pageTitle}} or {{pageRoute}} in your message as placeholders for the title or route of the page being saved
git.name:
type: text
default: GitSync
label: Committer Name
placeholder: GitSync
git.email:
type: text
default: git-sync@trilby.media
label: Committer Email
placeholder: git-sync@trilby.media
git.bin:
type: text
default: git
label: Git Binary Path
help: If the default `git` command doesn't work on your machine or if you want to specify a custom path, do it in here
placeholder: /usr/bin/git
logging:
type: toggle
default: 0
label: Log Git Commands
help: Logs git commands. Useful to debug and troubleshoot git execution
highlight: 0
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
Actions:
type: section
title: Actions
underline: true
_wizard:
type: git-wizard
label: Text Variable
help: Text to add to the top of a page
<?php
namespace Grav\Plugin\GitSync;
use Grav\Common\Grav;
use Grav\Common\Plugin;
use Grav\Common\Utils;
use Grav\Plugin\Admin\AdminBaseController;
class AdminController extends AdminBaseController
{
protected $action;
protected $target;
protected $active;
protected $plugin;
protected $task_prefix = 'task';
public $git;
/**
* @param Plugin $plugin
*/
public function __construct(Plugin $plugin)
{
$post = !empty($_POST) ? $_POST : [];
$this->grav = Grav::instance();
$this->active = false;
$uri = $this->grav['uri'];
$this->post = $this->getPost($post);
$this->plugin = $plugin;
// Ensure the controller should be running
if (Utils::isAdminPlugin()) {
$routeDetails = $this->grav['admin']->getRouteDetails();
$target = array_pop($routeDetails);
$this->git = new GitSync($plugin);
// return null if this is not running
if ($target != $plugin->name) {
return;
}
$this->action = !empty($this->post['action']) ? $this->post['action'] : $uri->param('action');
$this->target = $target;
$this->active = true;
$this->admin = Grav::instance()['admin'];
$task = !empty($post['task']) ? $post['task'] : $uri->param('task');
if ($task && ($this->target == $plugin->name || $uri->route() == '/lessons')) {
$this->task = $task;
$this->active = true;
}
}
}
public function taskTestConnection()
{
$post = $this->post;
$data = json_decode(base64_decode($post['test']));
try {
Helper::testRepository($data->user, $data->password, $data->repository);
echo json_encode([
'status' => "success",
'message' => 'The connection to the repository has been successful.'
]);
} catch (\Exception $e) {
$invalid = str_replace($data->password, '{password}', $e->getMessage());
echo json_encode([
'status' => "error",
'message' => $invalid
]);
}
exit;
}
public function taskSynchronize()
{
try {
$this->plugin->synchronize();
echo json_encode([
'status' => "success",
'message' => 'GitSync has successfully synchronized with the repository.'
]);
} catch (\Exception $e) {
$invalid = str_replace($this->git->getConfig('password', null), '{password}', $e->getMessage());
echo json_encode([
'status' => "error",
'message' => $invalid
]);
}
exit;
}
public function taskResetLocal()
{
try {
$this->plugin->reset();
echo json_encode([
'status' => "success",
'message' => 'GitSync has successfully reset your local changes and synchronized with the repository.'
]);
} catch (\Exception $e) {
$invalid = str_replace($this->git->getConfig('password', null), '{password}', $e->getMessage());
echo json_encode([
'status' => "error",
'message' => $invalid
]);
}
exit;
}
/**
* Performs a task or action on a post or target.
*
* @return bool|mixed
*/
public function execute()
{
$success = false;
$params = [];
// Handle Task & Action
if ($this->post && $this->task) {
// validate nonce
if (!$this->validateNonce()) {
return false;
}
$method = $this->task_prefix . ucfirst($this->task);
} elseif ($this->target) {
if (!$this->action) {
return false;
}
$method = strtolower($this->action) . ucfirst($this->target);
} else {
return false;
}
if (!method_exists($this, $method)) {
return false;
}
$success = call_user_func_array([$this, $method], $params);
// Grab redirect parameter.
$redirect = isset($this->post['_redirect']) ? $this->post['_redirect'] : null;
unset($this->post['_redirect']);
// Redirect if requested.
if ($redirect) {
$this->setRedirect($redirect);
}
return $success;
}
public function isActive()
{
return (bool) $this->active;
}
}
This diff is collapsed.
<?php
namespace Grav\Plugin\GitSync;
use Defuse\Crypto\Crypto;
use Grav\Common\Grav;
use SebastianBergmann\Git\RuntimeException;
class Helper {
private static $hash = '594ef69d-6c29-45f7-893a-f1b4342687d3';
/**
* Checks if the user/ folder is already initialized
*
* @return bool
*/
public static function isGitInitialized()
{
return file_exists(rtrim(USER_DIR, '/') . '/.git');
}
public static function isGitInstalled($version = false)
{
$bin = Helper::getGitBinary();
exec($bin . ' --version', $output, $returnValue);
$installed = $returnValue !== 0 ? false : true;
if ($version && $output) {
$output = explode(' ', array_shift($output));
$installed = array_filter($output, function($item) {
return version_compare($item, '0.0.1', '>=');
});
$installed = array_shift($installed);
}
return $installed;
}
public static function getGitBinary($override = false)
{
$grav = Grav::instance()['config'];
return $override ?: $grav->get('plugins.git-sync.git.bin', 'git');
}
public static function prepareRepository($user, $password, $repository)
{
$password = urlencode($password);
return str_replace('://', "://${user}:${password}@", $repository);
}
public static function testRepository($user, $password, $repository) {
$git = new GitSync();
$repository = self::prepareRepository($user, $password, $repository);
try {
return $git->testRepository($repository);
} catch (RuntimeException $e) {
return $e->getMessage();
}
}
public static function encrypt($password)
{
return 'gitsync-' . Crypto::encryptWithPassword($password, self::$hash);
}
public static function decrypt($enc_password)
{
if (substr($enc_password, 0, 8) === 'gitsync-') {
$enc_password = substr($enc_password, 8);
return Crypto::decryptWithPassword($enc_password, self::$hash);
} else {
return $enc_password;
}
}
public static function synchronize()
{
if (!Helper::isGitInstalled() || !Helper::isGitInitialized()) {
return true;
}
$git = new GitSync();
if ($git->hasChangesToCommit()) {
$git->commit();
}
// synchronize with remote
$git->sync();
return true;
}
public static function preventReadablePassword($str, $password) {
return str_replace(urlencode(self::decrypt($password)), '{password}', $str);
}
}
<?php namespace Grav\Plugin\Console;
use Grav\Console\ConsoleCommand;
use Grav\Plugin\GitSync\GitSync;
/**
* Class InitCommand
*
* @package Grav\Plugin\Console
*/
class InitCommand extends ConsoleCommand
{
protected function configure()
{
$this
->setName('init')
->setDescription('Initializes your git repository')
->setHelp('The <info>init</info> command runs the same git commands as the onAdminAfterSave function. Use this to manually initialize git-sync (useful for automated deployments).')
;
}
protected function serve()
{
require_once __DIR__ . '/../vendor/autoload.php';
$plugin = new GitSync();
$repository = $plugin->getConfig('repository', false);
$this->output->writeln('');
if (!$repository) {
$this->output->writeln('<red>ERROR:</red> No repository has been configured!');
}
$this->output->writeln('Initializing <cyan>' . $repository . '</cyan>');
$this->output->write('Starting initialization...');
$plugin->initializeRepository();
$plugin->setUser();
$plugin->addRemote();
$this->output->writeln('completed.');
}
}
<?php
namespace Grav\Plugin\Console;
use Grav\Console\ConsoleCommand;
use Grav\Plugin\GitSync\GitSync;
use Grav\Plugin\GitSync\Helper;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Input\InputOption;
/**
* Class LogCommand
*
* @package Grav\Plugin\Console
*/
class StatusCommand extends ConsoleCommand
{
protected function configure()
{
$this
->setName('status')
->setDescription('Checks the status of plugin config, git and git workspace. No files get modified!')
->addOption(
'fetch', 'f',
InputOption::VALUE_NONE,
'additionally do a git fetch to look updates (changes not files in workspace)'
)
->setHelp(<<<'EOF'
The <info>%command.name%</info> command checks if the plugin is usable the way it has been configured.
While doing this it prints the available information for your inspection.
<comment>No files in the workspace are modified when running this test.</comment>
The <info>--fetch</info> option can be used to see differences between the remote in the <info>git status</info> (last check)
It also returns with an error code and a helpful message when something is not normal:
<error>100</error> : <info>git</info> binary not working as expected
<error>50</error> : <info>repositoryFolder</info> and git workspace root do not match
<error>10</error> : <info>repository</info> is not configured
<error>5</error> : state of workspace not clean
<error>1</error> : Some checks can throw a <info>RuntimeException</info> which is not caught, read the message for details
EOF
)
;
}
protected function serve()
{
require_once __DIR__ . '/../vendor/autoload.php';
$plugin = new GitSync();
$this->output->writeln('');
$this->console_header('plugin runtime information:');
$info = $plugin->getRuntimeInformation();
$info['isGitInitialized'] = Helper::isGitInitialized();
$info['gitVersion'] = Helper::isGitInstalled(true);
ksort($info);
dump($info);
if (!Helper::isGitInstalled()) {
throw new RuntimeException('git binary not found', 100);
}
$this->console_header('detect git workspace root:');
$git_root = $plugin->execute('rev-parse --show-toplevel');
$this->console_log($git_root, '');
if (rtrim($info['repositoryPath'], '/') !== rtrim($git_root[0], '/')) {
throw new RuntimeException('git root and repositoryPath do not match', 50);
}
// needed to prevent out put in logs:
$password = Helper::decrypt($plugin->getPassword());
$this->console_header('local git config:');
$this->console_log(
$plugin->execute('config --local -l'), $password
);
$this->console_header(
'Testing connection to repository', 'git ls-remote', true
);
$repository = $plugin->getConfig('repository', false);
if (!$repository) {
throw new RuntimeException('No repository has been configured', 10);
}
$testRepository = $plugin->testRepository(
Helper::prepareRepository(
$plugin->getUser(),
$password,
$repository)
);
$this->console_log($testRepository, $password);
$fetched = false;
if ($this->input->getOption('fetch')) {
$remote = $plugin->getRemote('name', '');
$this->console_header(
'Looking for updates', "git fetch $remote", true
);
$this->console_log($plugin->fetch($remote), $password);
$fetched = true;
}
$this->console_header(
'Checking workspace status', 'git status', true
);
$git_status = $plugin->execute('status');
$this->console_log($git_status, $password);
if (!$plugin->isWorkingCopyClean()) {
throw new RuntimeException('Working state is not clean.', 5);
}
if ($fetched) {
$uptodate = strpos($git_status[1], 'branch is up-to-date with') > 0;
if ($uptodate) {
$this->console_header(
'Congrats: You should be able to run the <info>sync</info> command without problems!'
);
} else {
$this->output->writeln('<yellow>You are not in sync!</yellow>');
$this->output->writeln('Take a look at the output of git status to see more details.');
$this->output->writeln('In most cases the <info>sync</info> command is able to fix this.');
}
} else {
$this->console_header('Looks good: use <info>--fetch</info> option to check for updates.');
}
}
private function console_header($readable, $cmd = '', $remote_action = false)
{
$this->output->writeln(
"<yellow>$readable</yellow>" . ($cmd ? "(<info>$cmd</info>)" : ''). ($remote_action ? '...' : '')
);
}
private function console_log($lines, $password)
{
foreach ($lines as $line) {
$this->output->writeln(' ' . Helper::preventReadablePassword($line, $password));
}
}
}
<?php
namespace Grav\Plugin\Console;
use Grav\Console\ConsoleCommand;
use Grav\Plugin\GitSync\GitSync;
/**
* Class LogCommand
*
* @package Grav\Plugin\Console
*/
class SyncCommand extends ConsoleCommand
{
protected function configure()
{
$this
->setName('sync')
->setDescription('Performs a synchronization of your site')
->setHelp('The <info>sync</info> command performs a synchronization of your site. Useful if you want to run a periodic crontab job to automate it.')
;
}
protected function serve()
{
require_once __DIR__ . '/../vendor/autoload.php';
$plugin = new GitSync();
$repository = $plugin->getConfig('repository', false);
$this->output->writeln('');
if (!$repository) {
$this->output->writeln('<red>ERROR:</red> No repository has been configured');
}
$this->output->writeln('Synchronizing with <cyan>' . $repository . '</cyan>');
if ($plugin->hasChangesToCommit()) {
$this->output->writeln('Changes detected, adding and committing...');
$plugin->add();
$plugin->commit();
}
$this->output->write('Starting Synchronization...');
$plugin->sync();
$this->output->writeln('completed.');
}
}
{
"require": {
"sebastian/git": "^2.1",
"defuse/php-encryption": "^2.0"
},
"autoload": {
"psr-4": {
"Grav\\Plugin\\GitSync\\": "classes/"
}
},
"license": "Apache-2.0",
"authors": [
{
"name": "Trilby Media, LLC",
"email": "devs@trilbymedia.com"
}
]
}
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "49491bf051948fdafa70414b48b9ea34",
"packages": [
{
"name": "defuse/php-encryption",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/defuse/php-encryption.git",
"reference": "2c6fea3d9a4eaaa8cef86b2a89f3660818117b33"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/defuse/php-encryption/zipball/2c6fea3d9a4eaaa8cef86b2a89f3660818117b33",
"reference": "2c6fea3d9a4eaaa8cef86b2a89f3660818117b33",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"paragonie/random_compat": "~2.0",
"php": ">=5.4.0"
},
"require-dev": {
"nikic/php-parser": "^2.0"
},
"type": "library",
"autoload": {
"classmap": [
"src"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Hornby",
"email": "taylor@defuse.ca",
"homepage": "https://defuse.ca/"
},
{
"name": "Scott Arciszewski",
"email": "info@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "Secure PHP Encryption Library",
"keywords": [
"aes",
"authenticated encryption",
"cipher",
"crypto",
"cryptography",
"encrypt",
"encryption",
"openssl",
"security",
"symmetric key cryptography"
],
"time": "2016-10-10T15:20:26+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v2.0.4",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e",
"reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e",
"shasum": ""
},
"require": {
"php": ">=5.2.0"
},
"require-dev": {
"phpunit/phpunit": "4.*|5.*"
},
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
"autoload": {
"files": [
"lib/random.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
"keywords": [
"csprng",
"pseudorandom",
"random"
],
"time": "2016-11-07T23:38:38+00:00"
},
{
"name": "sebastian/git",
"version": "2.1.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/git.git",
"reference": "5100bc50cd9e70f424c643618e142214225024f3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/git/zipball/5100bc50cd9e70f424c643618e142214225024f3",
"reference": "5100bc50cd9e70f424c643618e142214225024f3",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Simple wrapper for Git",
"homepage": "http://www.github.com/sebastianbergmann/git",
"keywords": [
"git"
],
"time": "2016-06-15T09:30:19+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
@font-face {
font-family: 'gitsync';
src:
url('../fonts/gitsync.ttf?ivrc6k') format('truetype'),
url('../fonts/gitsync.woff?ivrc6k') format('woff'),
url('../fonts/gitsync.svg?ivrc6k#gitsync') format('svg');
font-weight: normal;
font-style: normal;
}
.fa.fa-git,
.fa.fa-git-square {
font-family: 'gitsync' !important;
vertical-align: middle;
}
.fa-git-square:before {
content: "\e900" !important;
}
.fa-git:before {
content: "\e901" !important;
}
[data-remodal-id="wizard"] .button[disabled], [data-remodal-id="wizard"] .button[disabled]:hover, [data-remodal-id="reset-local"] .button[disabled], [data-remodal-id="reset-local"] .button[disabled]:hover {
background: #ccc;
cursor: default; }
[data-remodal-id="wizard"] .button[disabled]:active, [data-remodal-id="reset-local"] .button[disabled]:active {
margin: 0; }
[data-remodal-id="wizard"] form [class^="step-"] a:not(.button):not([target]), [data-remodal-id="reset-local"] form [class^="step-"] a:not(.button):not([target]) {
vertical-align: middle;
color: #5591c7; }
[data-remodal-id="wizard"] form [class^="step-"] a:not(.button):not([target]):hover, [data-remodal-id="reset-local"] form [class^="step-"] a:not(.button):not([target]):hover {
color: #366188; }
[data-remodal-id="wizard"] .step-1 a, [data-remodal-id="reset-local"] .step-1 a {
vertical-align: middle; }
[data-remodal-id="wizard"] .access-tokens h3, [data-remodal-id="reset-local"] .access-tokens h3 {
margin-top: 1rem; }
[data-remodal-id="wizard"] .access-tokens a, [data-remodal-id="reset-local"] .access-tokens a {
vertical-align: inherit !important; }
[data-remodal-id="wizard"] .access-tokens-details > p, [data-remodal-id="reset-local"] .access-tokens-details > p {
margin-top: 0; }
[data-remodal-id="wizard"] .access-tokens-details > div > ul, [data-remodal-id="reset-local"] .access-tokens-details > div > ul {
margin-bottom: 0; }
[data-remodal-id="wizard"] .center, [data-remodal-id="reset-local"] .center {
text-align: center; }
[data-remodal-id="wizard"] h1, [data-remodal-id="reset-local"] h1 {
margin-bottom: 0;
padding-top: 0.5rem;
border-top: 3px solid transparent; }
[data-remodal-id="wizard"] .wizard-padding, [data-remodal-id="reset-local"] .wizard-padding {
padding: 0 3rem; }
[data-remodal-id="wizard"] .wizard-padding p, [data-remodal-id="reset-local"] .wizard-padding p {
padding: 0; }
[data-remodal-id="wizard"] label.disabled, [data-remodal-id="reset-local"] label.disabled {
color: #ccc; }
[data-remodal-id="wizard"] label img, [data-remodal-id="reset-local"] label img {
max-width: 100px;
display: inline-block;
vertical-align: middle;
margin-left: 0.5rem; }
[data-remodal-id="wizard"] label a, [data-remodal-id="reset-local"] label a {
margin-left: 0.5rem; }
[data-remodal-id="wizard"] .columns, [data-remodal-id="reset-local"] .columns {
display: flex;
align-items: center;
justify-content: center; }
[data-remodal-id="wizard"] .columns .column, [data-remodal-id="reset-local"] .columns .column {
flex: 1; }
[data-remodal-id="wizard"] .columns .column:first-child, [data-remodal-id="reset-local"] .columns .column:first-child {
width: 35%;
flex: none;
border-right: 1px solid #ddd;
margin-right: 2rem; }
[data-remodal-id="wizard"] .step-1 div.column:nth-child(1), [data-remodal-id="reset-local"] .step-1 div.column:nth-child(1) {
flex-grow: 1.5;
width: 15%; }
[data-remodal-id="wizard"] .step-1 div.column:nth-child(1) > label:nth-child(4), [data-remodal-id="reset-local"] .step-1 div.column:nth-child(1) > label:nth-child(4) {
width: 110%; }
[data-remodal-id="wizard"] .step-1 div.column:nth-child(2), [data-remodal-id="reset-local"] .step-1 div.column:nth-child(2) {
margin-left: 25px; }
[data-remodal-id="wizard"] .step-1 div.column:nth-child(2) > label:nth-child(1) > input:nth-child(1), [data-remodal-id="wizard"] .step-1 div.column:nth-child(2) > label:nth-child(2) > input:nth-child(1), [data-remodal-id="reset-local"] .step-1 div.column:nth-child(2) > label:nth-child(1) > input:nth-child(1), [data-remodal-id="reset-local"] .step-1 div.column:nth-child(2) > label:nth-child(2) > input:nth-child(1) {
width: 85%; }
[data-remodal-id="wizard"] .step-2 .info, [data-remodal-id="reset-local"] .step-2 .info {
margin: 0.2rem 0;
padding: 0.5rem 1.5rem; }
[data-remodal-id="wizard"] .step-2 ol, [data-remodal-id="wizard"] .step-2 ul, [data-remodal-id="reset-local"] .step-2 ol, [data-remodal-id="reset-local"] .step-2 ul {
padding-left: 1rem; }
[data-remodal-id="wizard"] .step-4 .info, [data-remodal-id="reset-local"] .step-4 .info {
font-size: 100%;
margin: 0.2rem 0; }
[data-remodal-id="wizard"] .step-4 .alert, [data-remodal-id="wizard"] .step-4 .warning, [data-remodal-id="reset-local"] .step-4 .alert, [data-remodal-id="reset-local"] .step-4 .warning {
padding: 0.5rem 1.5rem; }
[data-remodal-id="wizard"] .step-4 .fa.fa-warning, [data-remodal-id="reset-local"] .step-4 .fa.fa-warning {
color: #ff7d3b;
font-size: 1.2rem; }
[data-remodal-id="wizard"] .step-4 .wizard-padding label > *, [data-remodal-id="reset-local"] .step-4 .wizard-padding label > * {
vertical-align: middle; }
[data-remodal-id="wizard"] .step-4 .info-desc, [data-remodal-id="reset-local"] .step-4 .info-desc {
color: #0091ff;
float: right;
margin-right: .5rem;
font-size: 1.2rem; }
[data-remodal-id="wizard"] .step-4 hr, [data-remodal-id="reset-local"] .step-4 hr {
margin: .5rem 0; }
#admin-main [data-grav-field="git-wizard"] {
margin: 0 1rem; }
#admin-main [data-grav-field="git-wizard"] .danger.button-bar {
margin: 0;
padding: 0;
background: transparent; }
#admin-main [data-grav-field="git-wizard"] .button {
top: 0 !important;
-webkit-transform: translateY(0) !important;
-moz-transform: translateY(0) !important;
-ms-transform: translateY(0) !important;
-o-transform: translateY(0) !important;
transform: translateY(0) !important; }
/*# sourceMappingURL=../css-compiled/git-sync.css.map */
\ No newline at end of file
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="gitsync" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe900;" glyph-name="git-square" horiz-adv-x="878" d="M332.571 203.428c0-30.857-28-37.714-53.143-37.714-24.571 0-61.143 4-61.143 36 0 31.429 30.857 36.571 56 36.571 24 0 58.286-4 58.286-34.857zM312 469.714c0-28.571-11.429-48.571-42.286-48.571-31.429 0-44 18.286-44 48s11.429 51.429 44 51.429c29.143 0 42.286-24 42.286-50.857zM406.857 512.571v71.429c-24.571-9.143-50.857-16.571-77.143-16.571-18.857 10.857-40.571 16.571-62.857 16.571-65.143 0-116.571-48-116.571-114.286 0-35.429 23.429-84.571 58.857-96.571v-1.714c-18.286-8-21.714-30.286-21.714-48.571 0-18.857 6.857-34.286 23.429-44v-1.714c-38.857-12.571-64.571-37.143-64.571-79.429 0-72.571 69.143-93.143 129.714-93.143 73.143 0 128 26.857 128 107.429 0 57.143-52 74.286-99.429 82.857-16 2.857-43.429 14.286-43.429 34.286 0 18.857 10.286 26.857 28 29.714 58.286 11.429 95.429 56.571 95.429 116.571 0 10.286-2.286 20-5.714 29.714 9.143 2.286 18.857 4.571 28 7.429zM440.571 273.143h78.286c-1.143 15.429-1.143 31.429-1.143 46.857v221.143c0 13.143 0 26.286 1.143 39.429h-78.286c1.714-13.143 1.714-27.429 1.714-40.571v-224c0-14.286 0-28.571-1.714-42.857zM731.429 282.286v69.143c-11.429-8-25.143-12-38.857-12-25.714 0-30.286 25.714-30.286 46.857v128.571h29.714c10.286 0 20-1.143 30.286-1.143v66.857h-60c0 19.429-1.143 38.857 1.714 58.286h-80c1.714-10.286 2.286-20.571 2.286-31.429v-26.857h-34.286v-66.857c6.857 0.571 13.714 1.714 21.143 1.714 4 0 8.571-0.571 13.143-0.571v-1.143h-1.143v-124c0-61.714 9.143-121.143 84.571-121.143 21.143 0 42.857 3.429 61.714 13.714zM528 685.714c0 26.857-20 52-48 52s-48.571-24.571-48.571-52c0-26.857 21.143-50.857 48.571-50.857s48 24.571 48 50.857zM877.714 713.143v-548.571c0-90.857-73.714-164.571-164.571-164.571h-548.571c-90.857 0-164.571 73.714-164.571 164.571v548.571c0 90.857 73.714 164.571 164.571 164.571h548.571c90.857 0 164.571-73.714 164.571-164.571z" />
<glyph unicode="&#xe901;" glyph-name="git" d="M340 85.714c0 50.286-55.429 57.143-94.286 57.143-40.571 0-90.286-8.571-90.286-59.429 0-51.429 58.857-57.714 98.286-57.714 41.714 0 86.286 10.286 86.286 60zM306.286 517.143c0 42.857-20.571 81.714-68 81.714-52.571 0-70.857-34.857-70.857-82.857 0-47.429 20.571-77.143 70.857-77.143 49.714 0 68 32 68 78.286zM460 702.286v-115.429c-14.857-5.143-29.714-9.143-45.143-12.571 5.714-15.429 9.143-31.429 9.143-48 0-96.571-59.429-170.286-154.286-188-28.571-5.714-45.143-17.714-45.143-48.571 0-87.429 230.857-28 230.857-189.143 0-130.857-88.571-173.714-207.429-173.714-97.714 0-209.143 32.571-209.143 150.286 0 68.571 41.714 108 104 128.571v2.286c-26.286 16-38.286 41.143-38.286 72 0 29.143 6.286 65.143 36 78.286v2.286c-57.714 19.429-95.429 98.857-95.429 156.571 0 106.857 82.857 185.143 188.571 185.143 35.429 0 70.857-9.143 101.714-26.857 42.857 0 85.143 11.429 124.571 26.857zM641.714 198.857h-126.857c2.286 25.714 2.286 50.857 2.286 76.571v348c0 24.571 0.571 49.143-2.286 73.143h126.857c-2.857-23.429-2.286-47.429-2.286-70.857v-350.286c0-25.714 0-50.857 2.286-76.571zM985.143 325.714v-112c-30.286-16.571-65.143-22.286-99.429-22.286-122.286 0-136.571 96.571-136.571 196v200.571h1.143v2.286c-7.429 0-14.286 1.143-21.143 1.143-11.429 0-22.857-1.714-33.714-3.429v108.571h54.857v43.429c0 17.143-0.571 34.286-3.429 50.857h129.714c-4.571-31.429-3.429-62.857-3.429-94.286h97.714v-108.571c-16.571 0-33.143 2.286-49.143 2.286h-48.571v-208.571c0-33.714 7.429-74.857 49.714-74.857 22.286 0 44 6.286 62.286 18.857zM656 866.857c0-42.857-33.143-82.857-77.143-82.857-45.143 0-78.857 39.429-78.857 82.857 0 44 33.143 84 78.857 84 45.143 0 77.143-41.143 77.143-84z" />
</font></defs></svg>
\ No newline at end of file
This diff is collapsed.
#!/bin/sh
gosass -input scss/ -output css/ -sourcemap -watch -style compressed
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="bitbucket" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="863.566px" height="267.72px" viewBox="0 0 863.566 267.72" style="enable-background:new 0 0 863.566 267.72;"
xml:space="preserve">
<style type="text/css">
.st0{fill:#205081;}
</style>
<g>
<g>
<g>
<g>
<path class="st0" d="M432.851,136.489c-9.223,0-18.545,2.275-24.859,4.641v-34.558c0-1.738-1.414-3.146-3.15-3.146h-18.628
c-1.736,0-3.13,1.408-3.13,3.146v119.01c0,1.51,1.086,2.826,2.577,3.092c11.492,2.096,25.048,2.83,33.187,2.83
c34.984,0,42.139-14.87,42.139-37.211v-26.049C460.984,147.162,451.519,136.489,432.851,136.489z M419.926,209.871
c-4.717,0-8.624-0.182-11.935-0.571v-46.559c5.13-2.299,12.346-4.616,18.132-4.616c7.058,0,9.938,2.766,9.938,9.568v27.313
C436.061,204.862,433.568,209.871,419.926,209.871z"/>
<path class="st0" d="M546.674,138.31H528.07c-1.736,0-3.146,1.413-3.146,3.127v58.95c-6.71,3.401-16.155,6.929-21.777,6.929
c-4.193,0-5.742-1.549-5.742-5.746v-60.133c0-1.714-1.432-3.127-3.19-3.127h-18.583c-1.762,0-3.154,1.413-3.154,3.127v62.509
c0,18.283,7.195,27.559,21.369,27.559c9.872,0,23.308-3.392,34.652-8.726l1.372,4.645c0.409,1.344,1.617,2.265,3.028,2.265
l13.775-0.004c1.741,0,3.153-1.412,3.153-3.147v-85.1C549.827,139.723,548.415,138.31,546.674,138.31z"/>
<path class="st0" d="M621.62,210.423c-0.121-0.877-0.633-1.647-1.33-2.147c-0.732-0.489-1.636-0.653-2.493-0.46
c-5.337,1.216-10.939,1.874-16.195,1.874c-11.798,0-15.213-3.005-15.213-13.394v-24.6c0-10.397,3.415-13.402,15.213-13.402
c2.806,0,9.794,0.403,16.195,1.869c0.857,0.196,1.761,0.034,2.493-0.471c0.719-0.484,1.227-1.261,1.33-2.142l2.212-14.727
c0.22-1.552-0.694-3.03-2.212-3.474c-7.175-2.112-15.583-2.861-20.549-2.861c-28.132,0-39.604,10.246-39.604,35.392v24.231
c0,25.137,11.472,35.392,39.604,35.392c6.826,0,14.7-1.096,20.549-2.855c1.518-0.449,2.432-1.938,2.212-3.483L621.62,210.423z"
/>
<path class="st0" d="M749.865,136.489c-24.967,0-38.149,12.434-38.149,35.941v23.499c0,24.265,12.364,35.574,38.889,35.574
c10.792,0,22.304-1.892,31.566-5.171c1.472-0.53,2.353-2.075,2.045-3.621l-2.761-13.316c-0.184-0.855-0.716-1.61-1.452-2.05
c-0.755-0.459-1.655-0.58-2.491-0.337c-8.567,2.414-16.687,3.597-24.907,3.597c-13.556,0-15.97-4.393-15.97-13.587v-3.217
h46.213c1.755,0,3.148-1.393,3.148-3.156v-17.13C785.995,148.248,774.524,136.489,749.865,136.489z M736.635,173.262v-3.019
c0-8.77,4.279-12.857,13.419-12.857c10.1,0,12.117,4.928,12.117,12.857v3.019H736.635z"/>
<path class="st0" d="M302.116,138.269H283.51c-1.739,0-3.154,1.418-3.154,3.148v85.085c0,1.745,1.415,3.152,3.154,3.152h18.605
c1.779,0,3.168-1.407,3.168-3.152v-85.085C305.284,139.687,303.895,138.269,302.116,138.269z"/>
<path class="st0" d="M302.116,103.416H283.51c-1.739,0-3.154,1.428-3.154,3.157v16.029c0,1.763,1.415,3.159,3.154,3.159h18.605
c1.779,0,3.168-1.396,3.168-3.159v-16.029C305.284,104.844,303.895,103.416,302.116,103.416z"/>
<g>
<path class="st0" d="M255.251,164.776c7.711-4.242,11.059-10.188,11.059-19.331v-12.513c0-18.323-10.995-27.217-33.572-27.217
h-45.939c-1.721,0-3.133,1.408-3.133,3.145v117.642c0,1.745,1.412,3.152,3.133,3.152h49.213
c21.917,0,34.493-10.643,34.493-29.211v-12.922C270.504,176.444,264.881,168.172,255.251,164.776z M209.308,127.347h20.691
c9.366,0,10.676,4.087,10.676,8.463v10.721c0,6.972-3.255,9.95-10.86,9.95h-4.474c-1.762,0-3.174,1.417-3.174,3.157v14.781
c0,1.751,1.412,3.161,3.174,3.161h8.093c8.119,0,11.413,3.14,11.413,10.849v9.097c0,7.843-3.374,10.488-13.415,10.488h-22.122
V127.347z"/>
</g>
<path class="st0" d="M372.022,211.568c-0.123-0.886-0.612-1.666-1.347-2.166c-0.741-0.489-1.659-0.652-2.518-0.433
c-3.291,0.82-6.441,1.268-8.872,1.268c-4.602,0-6.646-2.003-6.646-6.476v-45.085h18.074c1.74,0,3.148-1.408,3.148-3.151v-14.069
c0-1.734-1.408-3.148-3.148-3.148h-18.074v-21.676c0-0.917-0.41-1.779-1.083-2.372c-0.694-0.606-1.617-0.88-2.52-0.749
l-18.605,2.59c-1.554,0.225-2.713,1.556-2.713,3.129v19.078h-10.145c-1.737,0-3.152,1.413-3.152,3.148v14.069
c0,1.743,1.415,3.151,3.152,3.151h10.145v48.007c0,16.472,8.646,24.835,25.738,24.835c4.868,0,13.128-1.127,18.526-2.999
c1.451-0.499,2.311-1.938,2.085-3.454L372.022,211.568z"/>
<path class="st0" d="M847.374,211.564c-0.122-0.886-0.632-1.666-1.373-2.168c-0.733-0.487-1.657-0.652-2.493-0.427
c-3.314,0.816-6.441,1.268-8.893,1.268c-4.582,0-6.665-2.009-6.665-6.481v-45.085h18.096c1.757,0,3.144-1.417,3.144-3.146
v-14.069c0-1.734-1.387-3.149-3.144-3.149H827.95v-21.68c0-0.919-0.368-1.78-1.066-2.371c-0.695-0.603-1.613-0.877-2.514-0.745
l-18.607,2.59c-1.553,0.22-2.722,1.551-2.722,3.113v19.093h-10.138c-1.722,0-3.147,1.414-3.147,3.149v14.069
c0,1.729,1.426,3.146,3.147,3.146h10.138v48.013c0,16.466,8.671,24.829,25.746,24.829c4.887,0,13.125-1.126,18.524-2.997
c1.433-0.501,2.326-1.934,2.104-3.454L847.374,211.564z"/>
</g>
</g>
</g>
</g>
<path class="st0" d="M708.825,224.391l-24.88-41.074l24.001-40.449c0.578-0.975,0.589-2.184,0.028-3.166
c-0.561-0.984-1.605-1.592-2.737-1.592h-20.553c-1.126,0-2.166,0.602-2.729,1.576l-22.832,39.584v-72.678
c0-1.741-1.411-3.15-3.15-3.15h-18.606c-1.739,0-3.15,1.409-3.15,3.15v119.911c0,1.74,1.411,3.15,3.15,3.15h18.606
c1.739,0,3.15-1.41,3.15-3.15v-39.244l24.295,40.654c0.568,0.951,1.596,1.535,2.704,1.535h20.173c0.006,0,0.014,0,0.02,0
c1.74,0,3.15-1.412,3.15-3.15C709.466,225.58,709.228,224.92,708.825,224.391z"/>
<path class="st0" d="M89.219,94.963v0.002V94.963c-33.675,0-61.172,9.053-61.172,20.294c0,2.961,7.343,45.415,10.256,62.251
c1.306,7.551,20.818,18.621,50.9,18.621l0.031-0.09v0.09c30.081,0,49.593-11.07,50.899-18.621
c2.913-16.836,10.256-59.29,10.256-62.251C150.39,104.017,122.894,94.963,89.219,94.963z M89.219,182.49
c-10.739,0-19.445-8.707-19.445-19.445c0-10.74,8.706-19.445,19.445-19.445c10.739,0,19.445,8.705,19.445,19.445
C108.664,173.783,99.958,182.49,89.219,182.49z M89.208,121.53c-21.636-0.035-39.169-3.794-39.162-8.398
c0.007-4.604,17.554-8.307,39.19-8.272c21.636,0.034,39.169,3.793,39.162,8.398C128.39,117.863,110.844,121.564,89.208,121.53z"/>
<path class="st0" d="M133.185,194.382c-0.93,0-1.675,0.658-1.675,0.658s-15.064,11.929-42.29,11.93
c-27.227-0.001-42.29-11.93-42.29-11.93s-0.746-0.658-1.675-0.658c-1.111,0-2.164,0.746-2.164,2.393
c0,0.174,0.017,0.348,0.049,0.518c2.338,12.514,4.046,21.393,4.346,22.744c2.041,9.205,20.048,16.151,41.733,16.152l0,0h0.001h0.001
l0,0c21.686-0.001,39.692-6.947,41.733-16.152c0.3-1.352,2.008-10.23,4.346-22.744c0.032-0.17,0.049-0.344,0.049-0.518
C135.349,195.128,134.295,194.382,133.185,194.382z"/>
<circle class="st0" cx="89.2" cy="163.039" r="9.745"/>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 2002 542" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<g transform="matrix(1,0,0,1,-199.492,-929.431)">
<g id="Layer-1" transform="matrix(4.16667,0,0,4.16667,0,0)">
<path d="M140.375,278.65L100.019,278.65C98.978,278.65 98.133,279.495 98.133,280.537L98.133,300.267C98.133,301.308 98.978,302.156 100.019,302.156L115.762,302.156L115.762,326.67C115.762,326.67 112.227,327.875 102.454,327.875C90.924,327.875 74.817,323.662 74.817,288.243C74.817,252.818 91.589,248.157 107.335,248.157C120.965,248.157 126.837,250.556 130.573,251.713C131.747,252.072 132.833,250.903 132.833,249.862L137.335,230.798C137.335,230.31 137.17,229.723 136.614,229.325C135.097,228.242 125.84,223.063 102.454,223.063C75.513,223.063 47.878,234.525 47.878,289.625C47.878,344.726 79.518,352.937 106.18,352.937C128.256,352.937 141.648,343.504 141.648,343.504C142.2,343.199 142.26,342.427 142.26,342.074L142.26,280.537C142.26,279.495 141.416,278.65 140.375,278.65" style="fill:rgb(14,13,13);fill-rule:nonzero;"/>
<path d="M348.353,229.665C348.353,228.615 347.521,227.768 346.48,227.768L323.757,227.768C322.719,227.768 321.875,228.615 321.875,229.665C321.875,229.67 321.881,273.578 321.881,273.578L286.462,273.578L286.462,229.665C286.462,228.615 285.626,227.768 284.587,227.768L261.866,227.768C260.832,227.768 259.989,228.615 259.989,229.665L259.989,348.568C259.989,349.617 260.832,350.471 261.866,350.471L284.587,350.471C285.626,350.471 286.462,349.617 286.462,348.568L286.462,297.709L321.881,297.709C321.881,297.709 321.82,348.564 321.82,348.568C321.82,349.617 322.663,350.471 323.702,350.471L346.478,350.471C347.519,350.471 348.351,349.617 348.353,348.568L348.353,229.665Z" style="fill:rgb(14,13,13);fill-rule:nonzero;"/>
<path d="M183.254,245.268C183.254,237.086 176.694,230.475 168.601,230.475C160.516,230.475 153.951,237.086 153.951,245.268C153.951,253.442 160.516,260.072 168.601,260.072C176.694,260.072 183.254,253.442 183.254,245.268" style="fill:rgb(14,13,13);fill-rule:nonzero;"/>
<path d="M181.629,323.486L181.629,268.6C181.629,267.558 180.788,266.706 179.749,266.706L157.098,266.706C156.059,266.706 155.129,267.778 155.129,268.819L155.129,347.455C155.129,349.765 156.569,350.453 158.433,350.453L178.841,350.453C181.08,350.453 181.629,349.353 181.629,347.418L181.629,323.486Z" style="fill:rgb(14,13,13);fill-rule:nonzero;"/>
<path d="M434.71,266.885L412.161,266.885C411.127,266.885 410.285,267.738 410.285,268.786L410.285,327.088C410.285,327.088 404.557,331.28 396.426,331.28C388.296,331.28 386.138,327.59 386.138,319.629L386.138,268.786C386.138,267.738 385.298,266.885 384.263,266.885L361.378,266.885C360.345,266.885 359.499,267.738 359.499,268.786L359.499,323.479C359.499,347.125 372.678,352.91 390.808,352.91C405.681,352.91 417.673,344.694 417.673,344.694C417.673,344.694 418.244,349.024 418.502,349.537C418.761,350.049 419.434,350.567 420.161,350.567L434.72,350.502C435.753,350.502 436.599,349.649 436.599,348.604L436.592,268.786C436.592,267.738 435.749,266.885 434.71,266.885" style="fill:rgb(14,13,13);fill-rule:nonzero;"/>
<path d="M487.445,331.207C479.624,330.969 474.319,327.42 474.319,327.42L474.319,289.766C474.319,289.766 479.552,286.558 485.973,285.984C494.093,285.257 501.918,287.71 501.918,307.08C501.918,327.506 498.386,331.537 487.445,331.207M496.339,264.214C483.532,264.214 474.821,269.928 474.821,269.928L474.821,229.665C474.821,228.615 473.982,227.768 472.946,227.768L450.159,227.768C449.123,227.768 448.281,228.615 448.281,229.665L448.281,348.568C448.281,349.617 449.123,350.471 450.162,350.471L465.971,350.471C466.683,350.471 467.222,350.103 467.621,349.461C468.013,348.822 468.581,343.978 468.581,343.978C468.581,343.978 477.898,352.809 495.538,352.809C516.246,352.809 528.122,342.305 528.122,305.654C528.122,269.003 509.155,264.214 496.339,264.214" style="fill:rgb(14,13,13);fill-rule:nonzero;"/>
<path d="M246.935,266.695L229.891,266.695C229.891,266.695 229.866,244.182 229.866,244.177C229.866,243.324 229.426,242.899 228.44,242.899L205.212,242.899C204.309,242.899 203.825,243.296 203.825,244.164L203.825,267.433C203.825,267.433 192.184,270.243 191.397,270.47C190.615,270.698 190.038,271.421 190.038,272.283L190.038,286.905C190.038,287.957 190.877,288.805 191.915,288.805L203.825,288.805L203.825,323.984C203.825,350.113 222.154,352.679 234.521,352.679C240.171,352.679 246.932,350.865 248.047,350.453C248.723,350.205 249.116,349.506 249.116,348.748L249.134,332.662C249.134,331.613 248.248,330.763 247.249,330.763C246.256,330.763 243.716,331.168 241.099,331.168C232.728,331.168 229.891,327.275 229.891,322.236C229.891,317.201 229.89,288.805 229.89,288.805L246.935,288.805C247.974,288.805 248.817,287.957 248.817,286.905L248.817,268.59C248.817,267.54 247.974,266.695 246.935,266.695" style="fill:rgb(14,13,13);fill-rule:nonzero;"/>
</g>
</g>
</svg>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 272.96 114.01"
version="1.1"
id="svg10"
sodipodi:docname="gitlogo.svg"
inkscape:version="0.92.0 r15299">
<metadata
id="metadata16">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs14" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1070"
inkscape:window-height="735"
id="namedview12"
showgrid="false"
inkscape:zoom="1.0807445"
inkscape:cx="115.66102"
inkscape:cy="55.154427"
inkscape:window-x="2350"
inkscape:window-y="328"
inkscape:window-maximized="0"
inkscape:current-layer="svg10" />
<path
fill="#f05133"
d="M111.78,51.977,62.035,2.2381c-2.8622-2.8648-7.5082-2.8648-10.374,0l-10.329,10.33,13.102,13.102c3.0459-1.0284,6.5371-0.33888,8.9639,2.0884,2.4394,2.4424,3.124,5.9634,2.0698,9.0195l12.628,12.628c3.0551-1.0528,6.58-0.37262,9.0195,2.0712,3.4106,3.4096,3.4106,8.9345,0,12.345-3.4111,3.4116-8.936,3.4116-12.349,0-2.5645-2.5665-3.1988-6.3345-1.8999-9.4942l-11.777-11.777-0.001,30.991c0.8315,0.41162,1.6162,0.961,2.3091,1.6509,3.4096,3.4092,3.4096,8.9331,0,12.348-3.4106,3.4091-8.938,3.4091-12.345,0-3.4101-3.4146-3.4101-8.9385,0-12.348,0.84275-0.84125,1.8179-1.478,2.8584-1.9048v-31.279c-1.041-0.425-2.015-1.057-2.859-1.905-2.583-2.581-3.2051-6.372-1.8804-9.5439l-12.916-12.918-34.106,34.105c-2.8657,2.867-2.8657,7.513,0,10.378l49.742,49.739c2.8638,2.8648,7.5082,2.8648,10.376,0l49.512-49.504c2.8648-2.8662,2.8648-7.5136,0-10.379"
id="path8" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:46.82492828px;line-height:27.43648148px;font-family:'Helvetica Rounded LT Std';-inkscape-font-specification:'Helvetica Rounded LT Std';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#999999;fill-opacity:1;stroke:none;stroke-width:1.0974592px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
x="128.30931"
y="69.483566"
id="text20"
transform="scale(0.9595033,1.0422059)"><tspan
sodipodi:role="line"
id="tspan18"
x="128.30931"
y="69.483566"
style="fill:#999999;stroke-width:1.0974592px;font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-weight: 300">Others</tspan></text>
</svg>
This diff is collapsed.
This diff is collapsed.
{
"name": "trilby-grav-plugin-gitsync",
"version": "1.1.0",
"description": "Git Sync Grav Plugin",
"main": "app/main.js",
"scripts": {
"watch": "NODE_ENV=development webpack --watch --progress --colors --mode development --config webpack.conf.js",
"dev": "NODE_ENV=development webpack --progress --colors --config webpack.conf.js",
"prod": "NODE_ENV=production webpack --mode production --config webpack.conf.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/trilbymedia/grav-plugin-git-sync.git"
},
"author": "Trilby Media, LLC",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/trilbymedia/grav-plugin-git-sync/issues"
},
"homepage": "https://github.com/trilbymedia/grav-plugin-git-sync#readme",
"dependencies": {
"vex-js": "^4.1.0"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"babel-loader": "^7.1.5",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"css-loader": "^1.0.0",
"eslint": "^5.2.0",
"eslint-loader": "^2.1.0",
"exports-loader": "^0.7.0",
"imports-loader": "^0.8.0",
"json-loader": "^0.5.7",
"style-loader": "^0.21.0",
"webpack": "^4.16.2",
"webpack-cli": "^3.1.0",
"whatwg-fetch": "^2.0.4"
}
}
$page-background: #f7f7f7;
$content-text: #666;
$header-background: $page-background;
$calendar-text: $content-text;
$calendar-details-background: #dcdcdc;
$calendar-details-background-alt: #cecece;
$calendar-day-background: #ffffff;
$toast-danger-background: #C62828;
// Vendors
@import "vendor/bourbon/bourbon";
// Load Template Configuration
@import "configuration/colors";
@import "plugin/wizard";
[data-remodal-id="wizard"], [data-remodal-id="reset-local"] {
.button[disabled] {
&, &:hover {
background: #ccc;
cursor: default;
}
&:active {
margin: 0;
}
}
form [class^="step-"] a:not(.button):not([target]) {
vertical-align: middle;
color: #5591c7;
&:hover {
color: #366188;
}
}
.step-1 a {
vertical-align: middle;
}
.access-tokens {
h3 {
margin-top: 1rem;
}
a {
vertical-align: inherit !important;
}
}
.access-tokens-details {
> p {
margin-top: 0;
}
> div > ul {
margin-bottom: 0;
}
}
.center {
text-align: center;
}
h1 {
margin-bottom: 0;
padding-top: 0.5rem;
border-top: 3px solid transparent;
}
.wizard-padding {
padding: 0 3rem;
p {
padding: 0;
}
}
label {
&.disabled {
color: #ccc;
}
img {
max-width: 100px;
display: inline-block;
vertical-align: middle;
margin-left: 0.5rem;
}
a {
margin-left: 0.5rem;
}
}
.columns {
display: flex;
align-items: center;
justify-content: center;
.column {
flex: 1;
&:first-child {
width: 35%;
flex: none;
border-right: 1px solid #ddd;
margin-right: 2rem;
}
}
}
.step-1 {
div.column:nth-child(1) {
flex-grow: 1.5;
width: 15%;
> label:nth-child(4) {
width: 110%;
}
}
div.column:nth-child(2) {
margin-left: 25px;
}
div.column:nth-child(2) > label:nth-child(1) > input:nth-child(1), div.column:nth-child(2) > label:nth-child(2) > input:nth-child(1) {
width: 85%;
}
}
.step-2 {
.info {
margin: 0.2rem 0;
padding: 0.5rem 1.5rem;
}
ol, ul {
padding-left: 1rem;
}
}
.step-4 {
.info {
font-size: 100%;
margin: 0.2rem 0;
}
.alert, .warning {
padding: 0.5rem 1.5rem;
}
.fa.fa-warning {
color: #ff7d3b;
font-size: 1.2rem;
}
.wizard-padding label > * {
vertical-align: middle;
}
.info-desc {
color: #0091ff;
float: right;
margin-right: .5rem;
font-size: 1.2rem;
}
hr {
margin: .5rem 0;
}
}
}
#admin-main [data-grav-field="git-wizard"] {
margin: 0 1rem;
.danger.button-bar {
margin: 0;
padding: 0;
background: transparent;
}
.button {
top: 0 !important;
@include transform(translateY(0) !important);
}
}
// Bourbon 4.2.7
// http://bourbon.io
// Copyright 2011-2015 thoughtbot, inc.
// MIT License
@import "settings/prefixer";
@import "settings/px-to-em";
@import "settings/asset-pipeline";
@import "functions/assign-inputs";
@import "functions/contains";
@import "functions/contains-falsy";
@import "functions/is-length";
@import "functions/is-light";
@import "functions/is-number";
@import "functions/is-size";
@import "functions/px-to-em";
@import "functions/px-to-rem";
@import "functions/shade";
@import "functions/strip-units";
@import "functions/tint";
@import "functions/transition-property-name";
@import "functions/unpack";
@import "functions/modular-scale";
@import "helpers/convert-units";
@import "helpers/directional-values";
@import "helpers/font-source-declaration";
@import "helpers/gradient-positions-parser";
@import "helpers/linear-angle-parser";
@import "helpers/linear-gradient-parser";
@import "helpers/linear-positions-parser";
@import "helpers/linear-side-corner-parser";
@import "helpers/radial-arg-parser";
@import "helpers/radial-positions-parser";
@import "helpers/radial-gradient-parser";
@import "helpers/render-gradients";
@import "helpers/shape-size-stripper";
@import "helpers/str-to-num";
@import "css3/animation";
@import "css3/appearance";
@import "css3/backface-visibility";
@import "css3/background";
@import "css3/background-image";
@import "css3/border-image";
@import "css3/calc";
@import "css3/columns";
@import "css3/filter";
@import "css3/flex-box";
@import "css3/font-face";
@import "css3/font-feature-settings";
@import "css3/hidpi-media-query";
@import "css3/hyphens";
@import "css3/image-rendering";
@import "css3/keyframes";
@import "css3/linear-gradient";
@import "css3/perspective";
@import "css3/placeholder";
@import "css3/radial-gradient";
@import "css3/selection";
@import "css3/text-decoration";
@import "css3/transform";
@import "css3/transition";
@import "css3/user-select";
@import "addons/border-color";
@import "addons/border-radius";
@import "addons/border-style";
@import "addons/border-width";
@import "addons/buttons";
@import "addons/clearfix";
@import "addons/ellipsis";
@import "addons/font-stacks";
@import "addons/hide-text";
@import "addons/margin";
@import "addons/padding";
@import "addons/position";
@import "addons/prefixer";
@import "addons/retina-image";
@import "addons/size";
@import "addons/text-inputs";
@import "addons/timing-functions";
@import "addons/triangle";
@import "addons/word-wrap";
@import "bourbon-deprecated-upcoming";
@charset "UTF-8";
/// Provides a quick method for targeting `border-color` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include border-color(#a60b55 #76cd9c null #e8ae1a);
/// }
///
/// @example css - CSS Output
/// .element {
/// border-left-color: #e8ae1a;
/// border-right-color: #76cd9c;
/// border-top-color: #a60b55;
/// }
///
/// @require {mixin} directional-property
///
/// @output `border-color`
@mixin border-color($vals...) {
@include directional-property(border, color, $vals...);
}
@charset "UTF-8";
/// Provides a quick method for targeting `border-radius` on both corners on the side of a box.
///
/// @param {Number} $radii
/// List of arguments
///
/// @example scss - Usage
/// .element-one {
/// @include border-top-radius(5px);
/// }
///
/// .element-two {
/// @include border-left-radius(3px);
/// }
///
/// @example css - CSS Output
/// .element-one {
/// border-top-left-radius: 5px;
/// border-top-right-radius: 5px;
/// }
///
/// .element-two {
/// border-bottom-left-radius: 3px;
/// border-top-left-radius: 3px;
/// }
///
/// @output `border-radius`
@mixin border-top-radius($radii) {
border-top-left-radius: $radii;
border-top-right-radius: $radii;
}
@mixin border-right-radius($radii) {
border-bottom-right-radius: $radii;
border-top-right-radius: $radii;
}
@mixin border-bottom-radius($radii) {
border-bottom-left-radius: $radii;
border-bottom-right-radius: $radii;
}
@mixin border-left-radius($radii) {
border-bottom-left-radius: $radii;
border-top-left-radius: $radii;
}
@charset "UTF-8";
/// Provides a quick method for targeting `border-style` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include border-style(dashed null solid);
/// }
///
/// @example css - CSS Output
/// .element {
/// border-bottom-style: solid;
/// border-top-style: dashed;
/// }
///
/// @require {mixin} directional-property
///
/// @output `border-style`
@mixin border-style($vals...) {
@include directional-property(border, style, $vals...);
}
@charset "UTF-8";
/// Provides a quick method for targeting `border-width` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include border-width(1em null 20px);
/// }
///
/// @example css - CSS Output
/// .element {
/// border-bottom-width: 20px;
/// border-top-width: 1em;
/// }
///
/// @require {mixin} directional-property
///
/// @output `border-width`
@mixin border-width($vals...) {
@include directional-property(border, width, $vals...);
}
@charset "UTF-8";
/// Generates variables for all buttons. Please note that you must use interpolation on the variable: `#{$all-buttons}`.
///
/// @example scss - Usage
/// #{$all-buttons} {
/// background-color: #f00;
/// }
///
/// #{$all-buttons-focus},
/// #{$all-buttons-hover} {
/// background-color: #0f0;
/// }
///
/// #{$all-buttons-active} {
/// background-color: #00f;
/// }
///
/// @example css - CSS Output
/// button,
/// input[type="button"],
/// input[type="reset"],
/// input[type="submit"] {
/// background-color: #f00;
/// }
///
/// button:focus,
/// input[type="button"]:focus,
/// input[type="reset"]:focus,
/// input[type="submit"]:focus,
/// button:hover,
/// input[type="button"]:hover,
/// input[type="reset"]:hover,
/// input[type="submit"]:hover {
/// background-color: #0f0;
/// }
///
/// button:active,
/// input[type="button"]:active,
/// input[type="reset"]:active,
/// input[type="submit"]:active {
/// background-color: #00f;
/// }
///
/// @require assign-inputs
///
/// @type List
///
/// @todo Remove double assigned variables (Lines 59–62) in v5.0.0
$buttons-list: 'button',
'input[type="button"]',
'input[type="reset"]',
'input[type="submit"]';
$all-buttons: assign-inputs($buttons-list);
$all-buttons-active: assign-inputs($buttons-list, active);
$all-buttons-focus: assign-inputs($buttons-list, focus);
$all-buttons-hover: assign-inputs($buttons-list, hover);
$all-button-inputs: $all-buttons;
$all-button-inputs-active: $all-buttons-active;
$all-button-inputs-focus: $all-buttons-focus;
$all-button-inputs-hover: $all-buttons-hover;
@charset "UTF-8";
/// Provides an easy way to include a clearfix for containing floats.
///
/// @link http://cssmojo.com/latest_new_clearfix_so_far/
///
/// @example scss - Usage
/// .element {
/// @include clearfix;
/// }
///
/// @example css - CSS Output
/// .element::after {
/// clear: both;
/// content: "";
/// display: table;
/// }
@mixin clearfix {
&::after {
clear: both;
content: "";
display: table;
}
}
@charset "UTF-8";
/// Truncates text and adds an ellipsis to represent overflow.
///
/// @param {Number} $width [100%]
/// Max-width for the string to respect before being truncated
///
/// @example scss - Usage
/// .element {
/// @include ellipsis;
/// }
///
/// @example css - CSS Output
/// .element {
/// display: inline-block;
/// max-width: 100%;
/// overflow: hidden;
/// text-overflow: ellipsis;
/// white-space: nowrap;
/// word-wrap: normal;
/// }
@mixin ellipsis($width: 100%) {
display: inline-block;
max-width: $width;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
}
@charset "UTF-8";
/// Georgia font stack.
///
/// @type List
$georgia: "Georgia", "Cambria", "Times New Roman", "Times", serif;
/// Helvetica font stack.
///
/// @type List
$helvetica: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif;
/// Lucida Grande font stack.
///
/// @type List
$lucida-grande: "Lucida Grande", "Tahoma", "Verdana", "Arial", sans-serif;
/// Monospace font stack.
///
/// @type List
$monospace: "Bitstream Vera Sans Mono", "Consolas", "Courier", monospace;
/// Verdana font stack.
///
/// @type List
$verdana: "Verdana", "Geneva", sans-serif;
/// Hides the text in an element, commonly used to show an image. Some elements will need block-level styles applied.
///
/// @link http://zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement
///
/// @example scss - Usage
/// .element {
/// @include hide-text;
/// }
///
/// @example css - CSS Output
/// .element {
/// overflow: hidden;
/// text-indent: 101%;
/// white-space: nowrap;
/// }
///
/// @todo Remove height argument in v5.0.0
@mixin hide-text($height: null) {
overflow: hidden;
text-indent: 101%;
white-space: nowrap;
@if $height {
@warn "The `hide-text` mixin has changed and no longer requires a height. The height argument will no longer be accepted in v5.0.0";
}
}
@charset "UTF-8";
/// Provides a quick method for targeting `margin` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include margin(null 10px 3em 20vh);
/// }
///
/// @example css - CSS Output
/// .element {
/// margin-bottom: 3em;
/// margin-left: 20vh;
/// margin-right: 10px;
/// }
///
/// @require {mixin} directional-property
///
/// @output `margin`
@mixin margin($vals...) {
@include directional-property(margin, false, $vals...);
}
@charset "UTF-8";
/// Provides a quick method for targeting `padding` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include padding(12vh null 10px 5%);
/// }
///
/// @example css - CSS Output
/// .element {
/// padding-bottom: 10px;
/// padding-left: 5%;
/// padding-top: 12vh;
/// }
///
/// @require {mixin} directional-property
///
/// @output `padding`
@mixin padding($vals...) {
@include directional-property(padding, false, $vals...);
}
@charset "UTF-8";
/// Provides a quick method for setting an element’s position. Use a `null` value to “skip” a side.
///
/// @param {Position} $position [relative]
/// A CSS position value
///
/// @param {Arglist} $coordinates [null null null null]
/// List of values that correspond to the 4-value syntax for the edges of a box
///
/// @example scss - Usage
/// .element {
/// @include position(absolute, 0 null null 10em);
/// }
///
/// @example css - CSS Output
/// .element {
/// left: 10em;
/// position: absolute;
/// top: 0;
/// }
///
/// @require {function} is-length
/// @require {function} unpack
@mixin position($position: relative, $coordinates: null null null null) {
@if type-of($position) == list {
$coordinates: $position;
$position: relative;
}
$coordinates: unpack($coordinates);
$offsets: (
top: nth($coordinates, 1),
right: nth($coordinates, 2),
bottom: nth($coordinates, 3),
left: nth($coordinates, 4)
);
position: $position;
@each $offset, $value in $offsets {
@if is-length($value) {
#{$offset}: $value;
}
}
}
@charset "UTF-8";
/// A mixin for generating vendor prefixes on non-standardized properties.
///
/// @param {String} $property
/// Property to prefix
///
/// @param {*} $value
/// Value to use
///
/// @param {List} $prefixes
/// Prefixes to define
///
/// @example scss - Usage
/// .element {
/// @include prefixer(border-radius, 10px, webkit ms spec);
/// }
///
/// @example css - CSS Output
/// .element {
/// -webkit-border-radius: 10px;
/// -moz-border-radius: 10px;
/// border-radius: 10px;
/// }
///
/// @require {variable} $prefix-for-webkit
/// @require {variable} $prefix-for-mozilla
/// @require {variable} $prefix-for-microsoft
/// @require {variable} $prefix-for-opera
/// @require {variable} $prefix-for-spec
@mixin prefixer($property, $value, $prefixes) {
@each $prefix in $prefixes {
@if $prefix == webkit {
@if $prefix-for-webkit {
-webkit-#{$property}: $value;
}
} @else if $prefix == moz {
@if $prefix-for-mozilla {
-moz-#{$property}: $value;
}
} @else if $prefix == ms {
@if $prefix-for-microsoft {
-ms-#{$property}: $value;
}
} @else if $prefix == o {
@if $prefix-for-opera {
-o-#{$property}: $value;
}
} @else if $prefix == spec {
@if $prefix-for-spec {
#{$property}: $value;
}
} @else {
@warn "Unrecognized prefix: #{$prefix}";
}
}
}
@mixin disable-prefix-for-all() {
$prefix-for-webkit: false !global;
$prefix-for-mozilla: false !global;
$prefix-for-microsoft: false !global;
$prefix-for-opera: false !global;
$prefix-for-spec: false !global;
}
@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-suffix: _2x, $asset-pipeline: $asset-pipeline) {
@if $asset-pipeline {
background-image: image-url("#{$filename}.#{$extension}");
} @else {
background-image: url("#{$filename}.#{$extension}");
}
@include hidpi {
@if $asset-pipeline {
@if $retina-filename {
background-image: image-url("#{$retina-filename}.#{$extension}");
} @else {
background-image: image-url("#{$filename}#{$retina-suffix}.#{$extension}");
}
} @else {
@if $retina-filename {
background-image: url("#{$retina-filename}.#{$extension}");
} @else {
background-image: url("#{$filename}#{$retina-suffix}.#{$extension}");
}
}
background-size: $background-size;
}
}
@charset "UTF-8";
/// Sets the `width` and `height` of the element.
///
/// @param {List} $size
/// A list of at most 2 size values.
///
/// If there is only a single value in `$size` it is used for both width and height. All units are supported.
///
/// @example scss - Usage
/// .first-element {
/// @include size(2em);
/// }
///
/// .second-element {
/// @include size(auto 10em);
/// }
///
/// @example css - CSS Output
/// .first-element {
/// width: 2em;
/// height: 2em;
/// }
///
/// .second-element {
/// width: auto;
/// height: 10em;
/// }
///
/// @todo Refactor in 5.0.0 to use a comma-separated argument
@mixin size($value) {
$width: nth($value, 1);
$height: $width;
@if length($value) > 1 {
$height: nth($value, 2);
}
@if is-size($height) {
height: $height;
} @else {
@warn "`#{$height}` is not a valid length for the `$height` parameter in the `size` mixin.";
}
@if is-size($width) {
width: $width;
} @else {
@warn "`#{$width}` is not a valid length for the `$width` parameter in the `size` mixin.";
}
}
@charset "UTF-8";
/// Generates variables for all text-based inputs. Please note that you must use interpolation on the variable: `#{$all-text-inputs}`.
///
/// @example scss - Usage
/// #{$all-text-inputs} {
/// border: 1px solid #f00;
/// }
///
/// #{$all-text-inputs-focus},
/// #{$all-text-inputs-hover} {
/// border: 1px solid #0f0;
/// }
///
/// #{$all-text-inputs-active} {
/// border: 1px solid #00f;
/// }
///
/// @example css - CSS Output
/// input[type="color"],
/// input[type="date"],
/// input[type="datetime"],
/// input[type="datetime-local"],
/// input[type="email"],
/// input[type="month"],
/// input[type="number"],
/// input[type="password"],
/// input[type="search"],
/// input[type="tel"],
/// input[type="text"],
/// input[type="time"],
/// input[type="url"],
/// input[type="week"],
/// textarea {
/// border: 1px solid #f00;
/// }
///
/// input[type="color"]:focus,
/// input[type="date"]:focus,
/// input[type="datetime"]:focus,
/// input[type="datetime-local"]:focus,
/// input[type="email"]:focus,
/// input[type="month"]:focus,
/// input[type="number"]:focus,
/// input[type="password"]:focus,
/// input[type="search"]:focus,
/// input[type="tel"]:focus,
/// input[type="text"]:focus,
/// input[type="time"]:focus,
/// input[type="url"]:focus,
/// input[type="week"]:focus,
/// textarea:focus,
/// input[type="color"]:hover,
/// input[type="date"]:hover,
/// input[type="datetime"]:hover,
/// input[type="datetime-local"]:hover,
/// input[type="email"]:hover,
/// input[type="month"]:hover,
/// input[type="number"]:hover,
/// input[type="password"]:hover,
/// input[type="search"]:hover,
/// input[type="tel"]:hover,
/// input[type="text"]:hover,
/// input[type="time"]:hover,
/// input[type="url"]:hover,
/// input[type="week"]:hover,
/// textarea:hover {
/// border: 1px solid #0f0;
/// }
///
/// input[type="color"]:active,
/// input[type="date"]:active,
/// input[type="datetime"]:active,
/// input[type="datetime-local"]:active,
/// input[type="email"]:active,
/// input[type="month"]:active,
/// input[type="number"]:active,
/// input[type="password"]:active,
/// input[type="search"]:active,
/// input[type="tel"]:active,
/// input[type="text"]:active,
/// input[type="time"]:active,
/// input[type="url"]:active,
/// input[type="week"]:active,
/// textarea:active {
/// border: 1px solid #00f;
/// }
///
/// @require assign-inputs
///
/// @type List
$text-inputs-list: 'input[type="color"]',
'input[type="date"]',
'input[type="datetime"]',
'input[type="datetime-local"]',
'input[type="email"]',
'input[type="month"]',
'input[type="number"]',
'input[type="password"]',
'input[type="search"]',
'input[type="tel"]',
'input[type="text"]',
'input[type="time"]',
'input[type="url"]',
'input[type="week"]',
'input:not([type])',
'textarea';
$all-text-inputs: assign-inputs($text-inputs-list);
$all-text-inputs-active: assign-inputs($text-inputs-list, active);
$all-text-inputs-focus: assign-inputs($text-inputs-list, focus);
$all-text-inputs-hover: assign-inputs($text-inputs-list, hover);
@charset "UTF-8";
/// CSS cubic-bezier timing functions. Timing functions courtesy of jquery.easie (github.com/jaukia/easie)
///
/// Timing functions are the same as demoed here: http://jqueryui.com/resources/demos/effect/easing.html
///
/// @type cubic-bezier
$ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530);
$ease-in-cubic: cubic-bezier(0.550, 0.055, 0.675, 0.190);
$ease-in-quart: cubic-bezier(0.895, 0.030, 0.685, 0.220);
$ease-in-quint: cubic-bezier(0.755, 0.050, 0.855, 0.060);
$ease-in-sine: cubic-bezier(0.470, 0.000, 0.745, 0.715);
$ease-in-expo: cubic-bezier(0.950, 0.050, 0.795, 0.035);
$ease-in-circ: cubic-bezier(0.600, 0.040, 0.980, 0.335);
$ease-in-back: cubic-bezier(0.600, -0.280, 0.735, 0.045);
$ease-out-quad: cubic-bezier(0.250, 0.460, 0.450, 0.940);
$ease-out-cubic: cubic-bezier(0.215, 0.610, 0.355, 1.000);
$ease-out-quart: cubic-bezier(0.165, 0.840, 0.440, 1.000);
$ease-out-quint: cubic-bezier(0.230, 1.000, 0.320, 1.000);
$ease-out-sine: cubic-bezier(0.390, 0.575, 0.565, 1.000);
$ease-out-expo: cubic-bezier(0.190, 1.000, 0.220, 1.000);
$ease-out-circ: cubic-bezier(0.075, 0.820, 0.165, 1.000);
$ease-out-back: cubic-bezier(0.175, 0.885, 0.320, 1.275);
$ease-in-out-quad: cubic-bezier(0.455, 0.030, 0.515, 0.955);
$ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1.000);
$ease-in-out-quart: cubic-bezier(0.770, 0.000, 0.175, 1.000);
$ease-in-out-quint: cubic-bezier(0.860, 0.000, 0.070, 1.000);
$ease-in-out-sine: cubic-bezier(0.445, 0.050, 0.550, 0.950);
$ease-in-out-expo: cubic-bezier(1.000, 0.000, 0.000, 1.000);
$ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.150, 0.860);
$ease-in-out-back: cubic-bezier(0.680, -0.550, 0.265, 1.550);
@mixin triangle($size, $color, $direction) {
$width: nth($size, 1);
$height: nth($size, length($size));
$foreground-color: nth($color, 1);
$background-color: if(length($color) == 2, nth($color, 2), transparent);
height: 0;
width: 0;
@if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) {
$width: $width / 2;
$height: if(length($size) > 1, $height, $height/2);
@if $direction == up {
border-bottom: $height solid $foreground-color;
border-left: $width solid $background-color;
border-right: $width solid $background-color;
} @else if $direction == right {
border-bottom: $width solid $background-color;
border-left: $height solid $foreground-color;
border-top: $width solid $background-color;
} @else if $direction == down {
border-left: $width solid $background-color;
border-right: $width solid $background-color;
border-top: $height solid $foreground-color;
} @else if $direction == left {
border-bottom: $width solid $background-color;
border-right: $height solid $foreground-color;
border-top: $width solid $background-color;
}
} @else if ($direction == up-right) or ($direction == up-left) {
border-top: $height solid $foreground-color;
@if $direction == up-right {
border-left: $width solid $background-color;
} @else if $direction == up-left {
border-right: $width solid $background-color;
}
} @else if ($direction == down-right) or ($direction == down-left) {
border-bottom: $height solid $foreground-color;
@if $direction == down-right {
border-left: $width solid $background-color;
} @else if $direction == down-left {
border-right: $width solid $background-color;
}
} @else if ($direction == inset-up) {
border-color: $background-color $background-color $foreground-color;
border-style: solid;
border-width: $height $width;
} @else if ($direction == inset-down) {
border-color: $foreground-color $background-color $background-color;
border-style: solid;
border-width: $height $width;
} @else if ($direction == inset-right) {
border-color: $background-color $background-color $background-color $foreground-color;
border-style: solid;
border-width: $width $height;
} @else if ($direction == inset-left) {
border-color: $background-color $foreground-color $background-color $background-color;
border-style: solid;
border-width: $width $height;
}
}
@charset "UTF-8";
/// Provides an easy way to change the `word-wrap` property.
///
/// @param {String} $wrap [break-word]
/// Value for the `word-break` property.
///
/// @example scss - Usage
/// .wrapper {
/// @include word-wrap(break-word);
/// }
///
/// @example css - CSS Output
/// .wrapper {
/// overflow-wrap: break-word;
/// word-break: break-all;
/// word-wrap: break-word;
/// }
@mixin word-wrap($wrap: break-word) {
overflow-wrap: $wrap;
word-wrap: $wrap;
@if $wrap == break-word {
word-break: break-all;
} @else {
word-break: $wrap;
}
}
// http://www.w3.org/TR/css3-animations/#the-animation-name-property-
// Each of these mixins support comma separated lists of values, which allows different transitions for individual properties to be described in a single style rule. Each value in the list corresponds to the value at that same position in the other properties.
@mixin animation($animations...) {
@include prefixer(animation, $animations, webkit moz spec);
}
@mixin animation-name($names...) {
@include prefixer(animation-name, $names, webkit moz spec);
}
@mixin animation-duration($times...) {
@include prefixer(animation-duration, $times, webkit moz spec);
}
@mixin animation-timing-function($motions...) {
// ease | linear | ease-in | ease-out | ease-in-out
@include prefixer(animation-timing-function, $motions, webkit moz spec);
}
@mixin animation-iteration-count($values...) {
// infinite | <number>
@include prefixer(animation-iteration-count, $values, webkit moz spec);
}
@mixin animation-direction($directions...) {
// normal | alternate
@include prefixer(animation-direction, $directions, webkit moz spec);
}
@mixin animation-play-state($states...) {
// running | paused
@include prefixer(animation-play-state, $states, webkit moz spec);
}
@mixin animation-delay($times...) {
@include prefixer(animation-delay, $times, webkit moz spec);
}
@mixin animation-fill-mode($modes...) {
// none | forwards | backwards | both
@include prefixer(animation-fill-mode, $modes, webkit moz spec);
}
@mixin appearance($value) {
@include prefixer(appearance, $value, webkit moz ms o spec);
}
@mixin backface-visibility($visibility) {
@include prefixer(backface-visibility, $visibility, webkit spec);
}
//************************************************************************//
// Background-image property for adding multiple background images with
// gradients, or for stringing multiple gradients together.
//************************************************************************//
@mixin background-image($images...) {
$webkit-images: ();
$spec-images: ();
@each $image in $images {
$webkit-image: ();
$spec-image: ();
@if (type-of($image) == string) {
$url-str: str-slice($image, 1, 3);
$gradient-type: str-slice($image, 1, 6);
@if $url-str == "url" {
$webkit-image: $image;
$spec-image: $image;
}
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser($image);
$webkit-image: map-get($gradients, webkit-image);
$spec-image: map-get($gradients, spec-image);
}
@else if $gradient-type == "radial" {
$gradients: _radial-gradient-parser($image);
$webkit-image: map-get($gradients, webkit-image);
$spec-image: map-get($gradients, spec-image);
}
}
$webkit-images: append($webkit-images, $webkit-image, comma);
$spec-images: append($spec-images, $spec-image, comma);
}
background-image: $webkit-images;
background-image: $spec-images;
}
//************************************************************************//
// Background property for adding multiple backgrounds using shorthand
// notation.
//************************************************************************//
@mixin background($backgrounds...) {
$webkit-backgrounds: ();
$spec-backgrounds: ();
@each $background in $backgrounds {
$webkit-background: ();
$spec-background: ();
$background-type: type-of($background);
@if $background-type == string or $background-type == list {
$background-str: if($background-type == list, nth($background, 1), $background);
$url-str: str-slice($background-str, 1, 3);
$gradient-type: str-slice($background-str, 1, 6);
@if $url-str == "url" {
$webkit-background: $background;
$spec-background: $background;
}
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser("#{$background}");
$webkit-background: map-get($gradients, webkit-image);
$spec-background: map-get($gradients, spec-image);
}
@else if $gradient-type == "radial" {
$gradients: _radial-gradient-parser("#{$background}");
$webkit-background: map-get($gradients, webkit-image);
$spec-background: map-get($gradients, spec-image);
}
@else {
$webkit-background: $background;
$spec-background: $background;
}
}
@else {
$webkit-background: $background;
$spec-background: $background;
}
$webkit-backgrounds: append($webkit-backgrounds, $webkit-background, comma);
$spec-backgrounds: append($spec-backgrounds, $spec-background, comma);
}
background: $webkit-backgrounds;
background: $spec-backgrounds;
}
@mixin border-image($borders...) {
$webkit-borders: ();
$spec-borders: ();
@each $border in $borders {
$webkit-border: ();
$spec-border: ();
$border-type: type-of($border);
@if $border-type == string or list {
$border-str: if($border-type == list, nth($border, 1), $border);
$url-str: str-slice($border-str, 1, 3);
$gradient-type: str-slice($border-str, 1, 6);
@if $url-str == "url" {
$webkit-border: $border;
$spec-border: $border;
}
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser("#{$border}");
$webkit-border: map-get($gradients, webkit-image);
$spec-border: map-get($gradients, spec-image);
}
@else if $gradient-type == "radial" {
$gradients: _radial-gradient-parser("#{$border}");
$webkit-border: map-get($gradients, webkit-image);
$spec-border: map-get($gradients, spec-image);
}
@else {
$webkit-border: $border;
$spec-border: $border;
}
}
@else {
$webkit-border: $border;
$spec-border: $border;
}
$webkit-borders: append($webkit-borders, $webkit-border, comma);
$spec-borders: append($spec-borders, $spec-border, comma);
}
-webkit-border-image: $webkit-borders;
border-image: $spec-borders;
border-style: solid;
}
//Examples:
// @include border-image(url("image.png"));
// @include border-image(url("image.png") 20 stretch);
// @include border-image(linear-gradient(45deg, orange, yellow));
// @include border-image(linear-gradient(45deg, orange, yellow) stretch);
// @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round);
// @include border-image(radial-gradient(top, cover, orange, yellow, orange));
@mixin calc($property, $value) {
#{$property}: -webkit-calc(#{$value});
#{$property}: calc(#{$value});
}
@mixin columns($arg: auto) {
// <column-count> || <column-width>
@include prefixer(columns, $arg, webkit moz spec);
}
@mixin column-count($int: auto) {
// auto || integer
@include prefixer(column-count, $int, webkit moz spec);
}
@mixin column-gap($length: normal) {
// normal || length
@include prefixer(column-gap, $length, webkit moz spec);
}
@mixin column-fill($arg: auto) {
// auto || length
@include prefixer(column-fill, $arg, webkit moz spec);
}
@mixin column-rule($arg) {
// <border-width> || <border-style> || <color>
@include prefixer(column-rule, $arg, webkit moz spec);
}
@mixin column-rule-color($color) {
@include prefixer(column-rule-color, $color, webkit moz spec);
}
@mixin column-rule-style($style: none) {
// none | hidden | dashed | dotted | double | groove | inset | inset | outset | ridge | solid
@include prefixer(column-rule-style, $style, webkit moz spec);
}
@mixin column-rule-width ($width: none) {
@include prefixer(column-rule-width, $width, webkit moz spec);
}
@mixin column-span($arg: none) {
// none || all
@include prefixer(column-span, $arg, webkit moz spec);
}
@mixin column-width($length: auto) {
// auto || length
@include prefixer(column-width, $length, webkit moz spec);
}
@mixin filter($function: none) {
// <filter-function> [<filter-function]* | none
@include prefixer(filter, $function, webkit spec);
}
This diff is collapsed.
@mixin font-face(
$font-family,
$file-path,
$weight: normal,
$style: normal,
$asset-pipeline: $asset-pipeline,
$file-formats: eot woff2 woff ttf svg) {
$font-url-prefix: font-url-prefixer($asset-pipeline);
@font-face {
font-family: $font-family;
font-style: $style;
font-weight: $weight;
src: font-source-declaration(
$font-family,
$file-path,
$asset-pipeline,
$file-formats,
$font-url-prefix
);
}
}
@mixin font-feature-settings($settings...) {
@if length($settings) == 0 { $settings: none; }
@include prefixer(font-feature-settings, $settings, webkit moz ms spec);
}
// HiDPI mixin. Default value set to 1.3 to target Google Nexus 7 (http://bjango.com/articles/min-device-pixel-ratio/)
@mixin hidpi($ratio: 1.3) {
@media only screen and (-webkit-min-device-pixel-ratio: $ratio),
only screen and (min--moz-device-pixel-ratio: $ratio),
only screen and (-o-min-device-pixel-ratio: #{$ratio}/1),
only screen and (min-resolution: round($ratio * 96dpi)),
only screen and (min-resolution: $ratio * 1dppx) {
@content;
}
}
@mixin hyphens($hyphenation: none) {
// none | manual | auto
@include prefixer(hyphens, $hyphenation, webkit moz ms spec);
}
@mixin image-rendering ($mode:auto) {
@if ($mode == crisp-edges) {
-ms-interpolation-mode: nearest-neighbor; // IE8+
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: crisp-edges;
}
@else {
image-rendering: $mode;
}
}
// Adds keyframes blocks for supported prefixes, removing redundant prefixes in the block's content
@mixin keyframes($name) {
$original-prefix-for-webkit: $prefix-for-webkit;
$original-prefix-for-mozilla: $prefix-for-mozilla;
$original-prefix-for-microsoft: $prefix-for-microsoft;
$original-prefix-for-opera: $prefix-for-opera;
$original-prefix-for-spec: $prefix-for-spec;
@if $original-prefix-for-webkit {
@include disable-prefix-for-all();
$prefix-for-webkit: true !global;
@-webkit-keyframes #{$name} {
@content;
}
}
@if $original-prefix-for-mozilla {
@include disable-prefix-for-all();
$prefix-for-mozilla: true !global;
@-moz-keyframes #{$name} {
@content;
}
}
$prefix-for-webkit: $original-prefix-for-webkit !global;
$prefix-for-mozilla: $original-prefix-for-mozilla !global;
$prefix-for-microsoft: $original-prefix-for-microsoft !global;
$prefix-for-opera: $original-prefix-for-opera !global;
$prefix-for-spec: $original-prefix-for-spec !global;
@if $original-prefix-for-spec {
@keyframes #{$name} {
@content;
}
}
}
@mixin linear-gradient($pos, $g1, $g2: null,
$g3: null, $g4: null,
$g5: null, $g6: null,
$g7: null, $g8: null,
$g9: null, $g10: null,
$fallback: null) {
// Detect what type of value exists in $pos
$pos-type: type-of(nth($pos, 1));
$pos-spec: null;
$pos-degree: null;
// If $pos is missing from mixin, reassign vars and add default position
@if ($pos-type == color) or (nth($pos, 1) == "transparent") {
$g10: $g9; $g9: $g8; $g8: $g7; $g7: $g6; $g6: $g5;
$g5: $g4; $g4: $g3; $g3: $g2; $g2: $g1; $g1: $pos;
$pos: null;
}
@if $pos {
$positions: _linear-positions-parser($pos);
$pos-degree: nth($positions, 1);
$pos-spec: nth($positions, 2);
}
$full: $g1, $g2, $g3, $g4, $g5, $g6, $g7, $g8, $g9, $g10;
// Set $g1 as the default fallback color
$fallback-color: nth($g1, 1);
// If $fallback is a color use that color as the fallback color
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
}
background-color: $fallback-color;
background-image: -webkit-linear-gradient($pos-degree $full); // Safari 5.1+, Chrome
background-image: unquote("linear-gradient(#{$pos-spec}#{$full})");
}
@mixin perspective($depth: none) {
// none | <length>
@include prefixer(perspective, $depth, webkit moz spec);
}
@mixin perspective-origin($value: 50% 50%) {
@include prefixer(perspective-origin, $value, webkit moz spec);
}
@mixin placeholder {
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
@each $placeholder in $placeholders {
&:#{$placeholder}-placeholder {
@content;
}
}
}
This diff is collapsed.
This diff is collapsed.
@mixin user-select($value: none) {
@include prefixer(user-select, $value, webkit moz ms spec);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment