Skip to content

Commit

Permalink
Merge branch 'feature/ghi-#36-theme-settings' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticicestudio committed Nov 1, 2016
2 parents b8f7e87 + 4d0a311 commit 98dfc25
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center"><img src="https://cdn.rawgit.com/arcticicestudio/nord-atom-ui/develop/assets/nord-atom-ui-banner.svg"/></p>

<p align="center"><img src="https://cdn.travis-ci.org/images/favicon-c566132d45ab1a9bcae64d8d90e4378a.svg" width=24 height=24/> <a href="https://travis-ci.org/arcticicestudio/nord-atom-ui"><img src="https://img.shields.io/travis/arcticicestudio/nord-atom-ui/develop.svg"/></a> <img src="https://assets-cdn.github.com/favicon.ico" width=24 height=24/> <a href="https://github.com/arcticicestudio/nord-atom-ui/releases/latest"><img src="https://img.shields.io/github/release/arcticicestudio/nord-atom-ui.svg"/></a> <a href="https://github.com/arcticicestudio/nord/releases/tag/v0.1.0"><img src="https://img.shields.io/badge/Nord-v0.1.0-blue.svg"/></a> <img src="https://atom.io/favicon.ico" width=24 height=24/> <a href="https://atom.io/themes/nord-atom-ui"><img src="https://img.shields.io/apm/v/nord-atom-ui.svg"/></a> <a href="https://atom.io/themes/nord-atom-ui"><img src="https://img.shields.io/apm/dm/nord-atom-ui.svg"/></a></p>
<p align="center"><img src="https://cdn.travis-ci.org/images/favicon-c566132d45ab1a9bcae64d8d90e4378a.svg" width=24 height=24/> <a href="https://travis-ci.org/arcticicestudio/nord-atom-ui"><img src="https://img.shields.io/travis/arcticicestudio/nord-atom-ui/develop.svg"/></a> <img src="https://circleci.com/favicon.ico" width=24 height=24/> <a href="https://circleci.com/gh/arcticicestudio/nord-atom-ui"><img src="https://circleci.com/gh/arcticicestudio/nord-atom-ui.svg?style=shield&circle-token=49d495671d604d752f1f1be8da675e3150dbdc88"/></a> <img src="https://assets-cdn.github.com/favicon.ico" width=24 height=24/> <a href="https://github.com/arcticicestudio/nord-atom-ui/releases/latest"><img src="https://img.shields.io/github/release/arcticicestudio/nord-atom-ui.svg"/></a> <a href="https://github.com/arcticicestudio/nord/releases/tag/v0.1.0"><img src="https://img.shields.io/badge/Nord-v0.1.0-blue.svg"/></a> <img src="https://atom.io/favicon.ico" width=24 height=24/> <a href="https://atom.io/themes/nord-atom-ui"><img src="https://img.shields.io/apm/v/nord-atom-ui.svg"/></a> <a href="https://atom.io/themes/nord-atom-ui"><img src="https://img.shields.io/apm/dm/nord-atom-ui.svg"/></a></p>

<p align="center">A arctic, north-bluish clean and elegant minimal Atom UI.</p>

Expand Down
26 changes: 26 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# title Circle CI Build Configuration +
# project nord-atom-ui +
# version +
# repository https://github.com/arcticicestudio/nord-atom-ui +
# author Arctic Ice Studio +
# email development@arcticicestudio.com +
# copyright Copyright (C) 2016 +
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# [References]
# Circle CI
# (https://circleci.com/docs)
machine:
environment:
ATOM_LINT_WITH_BUNDLED_NODE: "true"
APM_TEST_PACKAGES: ""

dependencies:
override:
- curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh
- chmod u+x build-package.sh

test:
override:
- ./build-package.sh
6 changes: 6 additions & 0 deletions index.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ copyright Copyright (C) 2016 +
> Package Support
Community
Core
> Theme Settings
[References]
Nord
Expand Down Expand Up @@ -72,3 +73,8 @@ LESSCSS
@import "styles/package-support/minimap";
@import "styles/package-support/project-manager";
@import "styles/package-support/timecop";

/*+----------------+
+ Theme Settings +
+----------------+*/
@import "styles/ui-theme-settings";
18 changes: 18 additions & 0 deletions lib/main.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = document.documentElement;

module.exports =
activate: (state) ->
atom.config.observe 'nord-atom-ui.tabSizing', (noFullWidth) ->
setTabSizing(noFullWidth)

deactivate: ->
unsetTabSizing()

setTabSizing = (noFullWidth) ->
if (noFullWidth)
unsetTabSizing()
else
root.setAttribute('theme-nord-atom-ui-tabsizing', "nofullwidth")

unsetTabSizing = ->
root.removeAttribute('theme-nord-atom-ui-tabsizing')
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"bugs": {
"url": "https://github.com/arcticicestudio/nord-atom-ui/issues"
},
"main": "./lib/main",
"keywords": [
"arctic",
"north",
Expand All @@ -24,5 +25,13 @@
"license": "MIT",
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"configSchema": {
"tabSizing": {
"title": "Full-Width Tab Sizing",
"description": "In full width mode, tabs will fill the whole tab bar.",
"type": "boolean",
"default": true
}
}
}
10 changes: 10 additions & 0 deletions spec/full-width-tab-sizing-spec.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe "Nord Atom UI theme", ->
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage('nord-atom-ui')

it "allows to disable full-width tab sizing to be set via theme settings", ->
expect(document.documentElement.getAttribute('theme-nord-atom-ui-tabsizing')).toBe null

atom.config.set('nord-atom-ui.tabSizing', false)
expect(document.documentElement.getAttribute('theme-nord-atom-ui-tabsizing')).toBe 'nofullwidth'
43 changes: 43 additions & 0 deletions styles/ui-theme-settings.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
title UI Theme Settings +
project nord-atom-ui +
version +
repository https://github.com/arcticicestudio/nord-atom-ui +
author Arctic Ice Studio +
email development@arcticicestudio.com +
copyright Copyright (C) 2016 +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[Index]
> Variables
> User Interface
Full-Width Tab Sizing
*/
/*+-----------+
+ Variables +
+-----------+*/
@theme-setting-tabsizing: ~'theme-@{ui-theme-name}-tabsizing';

/*+----------------+
+ User Interface +
+----------------+*/
/*+--- Full Width Tab Sizing ---+*/
[@{theme-setting-tabsizing}="nofullwidth"] {
.theme-setting-tabsizing-nofullwidth();
}

.theme-setting-tabsizing-nofullwidth() {
.tab-bar {
width: auto;

.tab {
width: inherit;
}

.tab.active,
.tab:hover.active {
width: inherit;
}
}
}
1 change: 1 addition & 0 deletions styles/ui-variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ copyright Copyright (C) 2016 +
/*+------------+
+ Animations +
+------------+*/
@ui-theme-name: nord-atom-ui;
@transition-time: 400ms;

/*+------+
Expand Down

0 comments on commit 98dfc25

Please sign in to comment.