Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanHavoc committed Jul 27, 2016
2 parents 3792744 + 3433b9f commit 9ea5c60
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
.idea
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Key|Value|Description
sample_dark_background|boolean|Set the background of the component sample area to be a dark color.
sample_background_color|string|Override sample background color. This option take precident over the dark background color.
sample_min_height|integer|Astrum detects if a component is hidden at desktop or mobile resolutions by detecting the components rendered height. When it’s hidden in your project CSS, Astrum shows a message to this effect. If the component is absolutely positioned, it has no height so you can set a min-height with this option to ensure it is shown properly and Astrum messaging is shown correctly.
sample_mobile_hidden|boolean|Typically used in conjunction with the `sample_min_height` option if a component is meant to be hidden at mobile resolutions set this option to true.
disable_auto_sample_hiding|object|Astrum automatically detects if you've hidden a component at mobile or desktop resolutions in your stylesheets. You can disable this feature using this option. Add `show_on_mobile` and `show_on_desktop` keys to the object with boolean values to set how the component should behave.

<a href=“#editing-components”></a>
## Editing Components
Expand Down Expand Up @@ -421,6 +421,8 @@ Navigate to the route of your project and then update your Astrum instance e.g.:

You will receive feedback that the update is complete.

There is also a `--force` option that you can use to force an update in the event that your Astrum instance is already on the current version. This is if you need to restore your Astrum instance core files.

<a href=“#contributing”></a>
## Contributing
Astrum was created by Ryan Taylor & Matt West of [No Divide](http://nodividestudio.com). We welcome anyone and everyone to contribute to the project and help us make Astrum as versatile as possible. If you decide to get involved, please take a moment to review our [contribution guidelines](.github/CONTRIBUTING.md):
Expand Down
10 changes: 5 additions & 5 deletions _template/app/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@
.ndpl-error code { background-color: #e07070; }
.ndpl-info code { background-color: #7098e0; }

.ndpl-error pre,
.ndpl-info pre {
.ndpl-error .ndpl-pre,
.ndpl-info .ndpl-pre {
margin-bottom: 0;
}

Expand Down Expand Up @@ -1014,10 +1014,10 @@
.ndpl-component__code {
border-bottom: 1px solid #E0E6ED;
}
.ndpl-component__code pre {
.ndpl-component__code .ndpl-pre {
margin: 0;
}
.ndpl-component__code code {
.ndpl-component__code .ndpl-code {
font-size: 12px;
line-height: 18px;
opacity: 0.75;
Expand Down Expand Up @@ -1054,7 +1054,7 @@
border: 1px solid #E0E6ED;
border-top: none;
}
.ndpl-component__code code {
.ndpl-component__code .ndpl-code {
font-size: 15px;
line-height: 21px;
padding: 36px;
Expand Down
2 changes: 1 addition & 1 deletion _template/app/css/styles.min.css

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions _template/app/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,28 @@ var ndplComponent = Vue.extend({

setTimeout(function() {
if(_this.$el.querySelector('.ndpl-component__code')) {

/**
* Auto-detect hidden sample.
*/
if (_this.$el.querySelector('.ndpl-component__sample').offsetHeight <= 74 &&
!_this.component.options.sample_always_show) {
!_this.component.options.disabled_auto_sample_hiding) {
_this.hide_sample_code = true;
}

if (!_this.$root.mobile_view &&
_this.component.options.sample_min_height) {
_this.hide_sample_code = false;
/**
* If manually specifying when to show nad hide samples.
*/
if (_this.component.options.disabled_auto_sample_hiding &&
_this.component.options.disabled_auto_sample_hiding.hasOwnProperty('show_on_mobile') &&
_this.component.options.disabled_auto_sample_hiding.hasOwnProperty('show_on_desktop')) {


if(_this.$root.mobile_view) {
_this.hide_sample_code = !_this.component.options.disabled_auto_sample_hiding.show_on_mobile;
} else {
_this.hide_sample_code = !_this.component.options.disabled_auto_sample_hiding.show_on_desktop;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion _template/app/js/main.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h3 class="ndpl-component__title">{{ component.title }}</h3>
</div>
<ul v-else class="ndpl-component__sample-missing ndpl-info">
<li class="ndpl-info__item">Locate this component in your <code>data.json</code> file and add your colors to the "colors" array that has been created for you e.g.:</li>
<li><pre>"colors": ["#4c4c4c","#7d8284","#a6b1b5","#e6eaf2","#FFFFFF"]</pre></li>
<li><pre class="ndpl-pre">"colors": ["#4c4c4c","#7d8284","#a6b1b5","#e6eaf2","#FFFFFF"]</pre></li>
</ul>
</template>
<template v-else>
Expand All @@ -256,7 +256,7 @@ <h3 class="ndpl-component__title">{{ component.title }}</h3>
<template v-if="component.html">
<div class="ndpl-component__code ndpl-c-border"
v-show="component.code_show">
<pre><code class="html" v-text="component.html"></code></pre>
<pre class="ndpl-pre"><code class="ndpl-code html" v-text="component.html"></code></pre>
</div>
<a class="ndpl-component__code-toggle ndpl-c-highlight ndpl-c-border"
@click.prevent="component.code_show = ! component.code_show"
Expand Down
24 changes: 22 additions & 2 deletions manager/astrum-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ utils.init();

program
.usage('[path]')
.description(chalk.yellow('Update an existing pattern library.'));
.description(chalk.yellow('Update an existing pattern library.'))
.option('-f, --force', 'Force update the Astrum instance. ');

/**
* Override argv[1] so that usage command is
Expand All @@ -26,14 +27,33 @@ program.parse(process.argv);
oldVersion = utils.$data.version;
newVersion = utils.$pjson.version;

if(newVersion !== oldVersion) {
/**
* Force restore instance.
*/
if (program.force && newVersion == oldVersion) {
utils.update(function () {
console.log();
console.log(chalk.grey('----------------------------------------------------------------'));
console.log(chalk.green('\u2713 Pattern library forcibly restored to ' + newVersion + '.'));
console.log(chalk.grey('----------------------------------------------------------------'));
console.log();
});

/**
* Update instance.
*/
} else if(newVersion !== oldVersion) {
utils.update(function () {
console.log();
console.log(chalk.grey('----------------------------------------------------------------'));
console.log(chalk.green('\u2713 Pattern library successfully updated from ' + oldVersion + ' to ' + newVersion + '.'));
console.log(chalk.grey('----------------------------------------------------------------'));
console.log();
});

/**
* Instance up-to-date.
*/
} else {
console.log();
console.log(chalk.grey('----------------------------------------------------------------'));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astrum",
"version": "1.5.12",
"version": "1.5.15",
"description": "A lightweight pattern library designed to be included with any web project.",
"main": "./manager/astrum.js",
"scripts": {
Expand Down

0 comments on commit 9ea5c60

Please sign in to comment.