Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Resolve SCSS variables #77

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ Bugfixes
Features
--------

* Added support for LESS - you are even able to pass both SASS/SCSS and LESS
files to Nucleus at the same time.

* Added version console output

Bugfixes
--------

* Show warning if substitution attempt with unknown selector and return empty
string instead of 'undefined'.

* Lots of documentation typo fixes and small style fixes for both Nucleus
and the docs.
* Added support for @script annotations (shout-out to jcfariadias,
pieplu and Joao Dias).

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Ryan Potter ([Github](https://github.com/rhym) • [Twitter](https://twitter.

Thomas Carlson ([Github](https://github.com/thomas0c) • [Twitter](https://twitter.com/thomasoc))

Philipp Mandler ([Github](https://github.com/phlmn))

# Special thanks to

Alexander Zhukov ([GitHub](https://github.com/nogizhopaboroda) • [Twitter](https://twitter.com/nogizhopaboroda))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![npm](https://badge.fury.io/js/nucleus-styleguide.svg)](https://www.npmjs.com/package/nucleus-styleguide)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](LICENSE)

Nucleus is a living style guide generator for atomic css based components. It's a Node application parsing the source SCSS files and reading information from DocBlock annotations.
Nucleus is a living style guide generator for atomic css based components. It's a Node application parsing the source CSS / SCSS / LESS files and reading information from DocBlock annotations.

![Nucleus Preview](https://holidaypirates.github.io/nucleus/images/git-teaser.png)

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/CommonUiModule/directives/copy-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $('[data-d-copy]').each(function (i, element ) {
copy.on('success', function () {
SweetAlert({
title: "Copied!",
type: "success",
icon: "success",
confirmButtonText: "Cool",
timer: 1500,
allowOutsideClick: true
Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

'use strict';

require('CommonUiModule/module');
require('./CommonUiModule/module');
1 change: 1 addition & 0 deletions assets/styles/molecules/logo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

.SG-logo__name {
@include lato(700);

font-size: 22px;
display: inline-block;
vertical-align: baseline;
Expand Down
1 change: 1 addition & 0 deletions assets/styles/molecules/mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
.SG-mixin {
@include lato(300);

font-size: 22px;
margin-bottom: 1.5em;

Expand Down
9 changes: 8 additions & 1 deletion assets/styles/molecules/navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
.SG-nav {
@include reset();

list-style-type: none;
text-align: center;

Expand All @@ -42,6 +43,7 @@
margin: 0 15px;
color: $color--gray;
font-size: 16px;

&:hover {
color: $color--dark-gray;
border-bottom: 2px solid $color--light-gray;
Expand All @@ -52,6 +54,7 @@
border-bottom: 3px solid $color--accent;
margin-bottom: -1px;
color: $color--dark-gray;

&:hover {
border-bottom: 3px solid $color--accent;
}
Expand Down Expand Up @@ -80,19 +83,22 @@
*/
.SG-nav-icons {
@include reset();

list-style-type: none;
line-height: 67px;
text-align: right;

li {
display: inline-block;

&:not(:last-child) {
margin-right: 2em;
}
}

.SG-nav-icons__item {
color: $color--light-gray;

&:hover {
color: $color--gray;
}
Expand Down Expand Up @@ -129,7 +135,7 @@
margin-bottom: 4em;

ul {
padding-left: 0em;
padding-left: 0;
line-height: 30px;
margin: 0;
}
Expand Down Expand Up @@ -157,6 +163,7 @@
padding-bottom: 0.5em;
margin-bottom: 0.5em;
font-size: 16px;

&:not(:first-child) {
margin-top: 2em;
}
Expand Down
4 changes: 3 additions & 1 deletion assets/styles/molecules/nuclide-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@
border-left-width: 3px;
font-size: 14px;


.SG-config__row {
@include clearAfter();

&:not(:last-of-type) {
border-bottom: 1px solid $color--light-gray;
}
}

.SG-config__label {
@include lato(600);

padding: 10px 20px;
min-width: 150px;
display: block;
Expand All @@ -46,6 +47,7 @@

.SG-config__value {
@include monospace();

padding: 10px 20px;
display: inline-block;

Expand Down
1 change: 1 addition & 0 deletions assets/styles/molecules/tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
*/
.SG-table {
@include reset();

width: 100%;

.SG-table__cell {
Expand Down
7 changes: 7 additions & 0 deletions assets/styles/nuclides/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@ $color--dark-gray: #4a4a4a;
* @section Grayscale
*/
$color--blackish: #333;

/**
* Half transparent black
* @color
* @section Transparency
*/
$color--semi-transparent: rgba(0, 0, 0, 0.5);
1 change: 1 addition & 0 deletions assets/styles/nuclides/grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// of the MIT license. See the LICENSE file for details.

@import "node_modules/gridle/sass/gridle/gridle";

@include gridle_setup( (
context : 12,
gutter-width : 20px,
Expand Down
3 changes: 2 additions & 1 deletion assets/styles/nuclides/tools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
* @include clearHard();
*/
@mixin clearHard() {
&::after, &::before {
&::after,
&::before {
content: "";
display: block;
height: 1px;
Expand Down
4 changes: 2 additions & 2 deletions assets/styles/nuclides/z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ $z-map: (
@if map-has-key($z, $type) {

// Check if 'name' is available
@if map-has-key(map-get($z,$type), $name) {
z-index: map-get(map-get($z,$type), $name);
@if map-has-key(map-get($z, $type), $name) {
z-index: map-get(map-get($z, $type), $name);
} @else {
@warn 'There is not elements "#{$name}" in the z map available.';
}
Expand Down
4 changes: 1 addition & 3 deletions assets/styles/structures/alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
// This software may be modified and distributed under the terms
// of the MIT license. See the LICENSE file for details.

@import "../../node_modules/sweetalert/dist/sweetalert";

.sweet-alert .confirm {
.swal-button--confirm {
background-color: $color--accent !important;
}
1 change: 1 addition & 0 deletions assets/styles/structures/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
.SG-header {
@include reset();
@include clearAfter();

border-bottom: 1px solid $color--whitesmoke;
padding: 0 40px;
margin-bottom: 100px;
Expand Down
4 changes: 4 additions & 0 deletions assets/styles/structures/icon-preview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

.SG-icon-preview {
@include reset();

margin-bottom: 50px;

.SG-icon-preview__name {
@include reset();

color: $color--accent;
display: inline-block;
}
Expand All @@ -21,6 +23,7 @@
display: inline-block;
line-height: 1;
width: 12.5%;

&::after {
display: block;
font-size: 12px;
Expand All @@ -31,6 +34,7 @@

.SG-icon-preview__copy {
margin-top: 15px;

.SG-ico {
font-size: 12px;
}
Expand Down
2 changes: 2 additions & 0 deletions assets/styles/structures/layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
.SG-layout {
@include reset();

width: 100%;
max-width: 937px;
margin-left: auto;
Expand Down Expand Up @@ -45,6 +46,7 @@
float: left;
width: 20%;
}

.SG-layout__content {
float: right;
width: 75%;
Expand Down
4 changes: 2 additions & 2 deletions assets/views/common/demo.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
* of the MIT license. See the LICENSE file for details.

.SG-row: .SG-gr-12: .SG-hint.SG-p.
<span class="SG-strong">Hint:</span><br>This is the generated style guide for Nucleus and it's documentation
pages. These are the actual components used, and the pages are generated with Nucleus itself. Feel free to browse a bit and try things out.
<span class="SG-strong">Hint:</span><br>This is the generated style guide for Nucleus and it's documentation
pages. These are the actual components used, and the pages are generated with Nucleus itself. Feel free to browse a bit and try things out. <a href="https://holidaypirates.github.io/nucleus/" class="SG-a SG-a--pink">Back to the home page</a>
8 changes: 4 additions & 4 deletions assets/views/entities/colors.pug
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ mixin colors-header()
div.SG-gr-2
div.SG-table__head.SG-table__cell Hex
div.SG-gr-3.SG-no-gutter-right
div.SG-table__head.SG-table__cell RGBA
div.SG-table__head.SG-table__cell RGB

mixin color(color)
div.SG-row.SG-table.SG-row-align-middle
a.SG-anchor(name=color.hash)
div.SG-gr-2.SG-no-gutter-left
div.SG-table__cell
div.SG-color-preview
div.SG-color-preview__circle(style="background-color: " + color.values.hex + "; border-color: " + color.values.darker)
div.SG-color-preview__typo(style="color: " + color.values.hex) Aa
div.SG-color-preview__circle(style="background-color: " + color.values.rgb + "; border-color: " + color.values.darker)
div.SG-color-preview__typo(style="color: " + color.values.rgb) Aa
div.SG-gr-3
div.SG-table__cell
span.SG-strong
Expand All @@ -43,4 +43,4 @@ mixin color(color)
span.SG-a(data-d-copy, data-clipboard-text=color.values.hex) #{color.values.hex}
div.SG-gr-3.SG-no-gutter-right
div.SG-table__cell
span.SG-a(data-d-copy, data-clipboard-text=color.values.rgba) #{color.values.rgba}
span.SG-a(data-d-copy, data-clipboard-text=color.values.rgb) #{color.values.rgb}
Binary file modified build/fonts/SG-icons.eot
Binary file not shown.
Binary file modified build/fonts/SG-icons.ttf
Binary file not shown.
Binary file modified build/fonts/SG-icons.woff
Binary file not shown.
9 changes: 1 addition & 8 deletions build/scripts/app.js

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions build/styles/app.css

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions default.nucleus.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
"title": "Nucleus",
"files": [
"*.scss",
"**/*.scss"
"**/*.scss",
"*.less",
"**/*.less"
],
"target" : "styleguide",
"css" : null,
"namespace": "page",
"verbose" : 3,
"counterCSS" : null,
"staticLipsum" : false,
"placeholderService" : false
"placeholderService" : false,
"scssEntry": null
}
8 changes: 4 additions & 4 deletions docs/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ gulp.task('build:views', [], function () {
'app': './app',
},
output: {
path: config.target + '/scripts/',
path: __dirname + '/' + config.target + '/scripts/',
publicPath: '/scripts/',
filename: '[name].js',
chunkFilename: '[chunkhash].bundle.js'
Expand All @@ -159,9 +159,9 @@ gulp.task('build:views', [], function () {
},
amd: {jQuery: true },
resolve: {
fallback: [
__dirname + '/' + config.sources + '/scripts'
]
// fallback: [
// __dirname + '/' + config.sources + '/scripts'
// ]
},
plugins: [
new webpack.ProvidePlugin({
Expand Down
2 changes: 1 addition & 1 deletion docs/src/scripts/preview-draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require('jquery-ui/ui/widgets/mouse');
require('jquery-ui/ui/widgets/resizable');
require('touchpunch');
require('./touchpunch');

$('.split-pane__preview').resizable({
handles: 'e'
Expand Down
2 changes: 1 addition & 1 deletion docs/src/views/layouts/base.pug
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ html(lang="en")
meta(property='og:title', content='Powerful management for crafted styles')
meta(property='og:site_name', content='Nucleus')
meta(property='og:url', content='https://holidaypirates.github.io/nucleus/')
meta(property='og:description', content='A developer orientated living style guide generator for SCSS')
meta(property='og:description', content='A developer orientated living style guide generator for SCSS and LESS')
meta(property='og:type', content='website')
meta(property='og:image', content='https://holidaypirates.github.io/nucleus/images/split-preview.png')

Expand Down
4 changes: 2 additions & 2 deletions docs/src/views/vendored-elements.pug
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ block content
p.SG-p.
The solution for this is quite straigt-forward. Create empty dummy elements
that match the vendored elements and put the annotations there. Since
Nucleus is working with the SCSS source files, it is not important
Nucleus is working with the CSS source files, it is not important
if a selector contains style declarations or not. In the end, after
transpiling SCSS to CSS, the empty selector will not be in the CSS file.
transpiling SCSS (or LESS) to CSS, the empty selector will not be in the CSS file.

code.code.language-nucleus(data-d-code-preview).
/**
Expand Down
Loading