Giter Club home page Giter Club logo

jacket's People

Contributors

cdooms avatar driesd avatar rob-bar avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jacket's Issues

Feedback from Loop naar de Maan

  • Uncomment components inclusion:
// Components styles
@import "components/**/*";
  • Change "media" to "width" in _shortcuts.scss:
@function med($breakpoint, $breakpoints: $breakpoints) {
  @return mdg($breakpoints, $breakpoint, "width");
}
  • (already fixed) Disable minCSS task in SASS task for easier debugging.
return gulp.src(config.path.scss)
    .pipe(sourcemaps.init())
    .pipe(sassGlob())
    .pipe(sass({
      includePaths: [
        require("node-bourbon").includePaths,
        require("node-neat").includePaths[1],
        require("node-normalize-scss").includePaths,
        config.path.bower + config.path.fontAwesome
      ],
      //importer: jsonImporter,
      outputStyle: config.sass.style,
      errLogToConsole: true
    }))
    .pipe(prefix(config.autoprefixer))
    //.pipe(mincss())
    .pipe(sourcemaps.write())
    .pipe(gulp.dest(config.path.css))
    .pipe(browserSync.stream());

Remove em on maxwidth in grid.

in _neat.scss
$max-width: em(1170);
should be in pixels, because you do not want to adjust the width of your site based on your body font-size
This is an edge case.
should be:
$max-width: 1170px;

Take the same structure as the ocelot theme for the main gulp tasks, will be easier for generating code

Jacket tasks:

// -----------------------------------------------------------------------------
// DEFAULT TASK
// -----------------------------------------------------------------------------

gulp.task("default", gulpSequence(
    "help",
    "sass",
   // "css-minify",
    "scss-lint",
    "jade",
    "watch",
    "browser-sync"
  )
);

Ocelot tasks:

// -----------------------------------------------------------------------------
// DEFAULT TASK
// -----------------------------------------------------------------------------

gulp.task("default", gulpSequence(
    "install",
    "compile",
    "lint",
    "improve",
    "serve"
  )
);

gulp.task("install", [
  "help"
  //here should be an install task
]);

gulp.task("compile", [
  "sass",
  "browserify"
]);

gulp.task("lint", [
  "scss-lint",
  "jshint"
]);

gulp.task("improve", [
  "uglify"
]);

gulp.task("serve", [
  "watch",
  "browser-sync"
]);

Ignore css

Css should be ignored because it conflicts sometimes.
Compilation for ocelot projects should be done on the server.

Remove the folders in components

Current:

  • blocks/ <= remove
  • drupal/ <= remove
  • menus/
  • misc/
  • views/ <= remove

add:

  • form/
  • buttons/
  • teasers/
  • identity/

Result, also singularized:

  • menu/
  • misc/
  • form/
  • button/
  • identity/ (logo's and identity related things)
  • teaser/ (mostly cards with image title descr or something like that)

Vertical rhythm

This is related to ausybenelux/Ocelot#50
We now have a piece of compass in our project, but this must be reviewed to something better and something that works better with bourbon.

Move #203 from Ocelot to Jacket -- Simple helpers for maps

#203 in https://github.com/Crosscheck/Ocelot: added shortcut for color in color-map + updated scss-files to use this shortcut

Original issue:

1 sqndr

Since the colors and timings are now sass maps, let's include some functions to get the colors and timings.

Example:

@function get-color($color) {
  @if map-has-key($color-scheme, $color) {
    @return map-get($color-scheme, $color);
  } @else {
    @error "ERROR: The color is not availible.";
  }
}

Based in this, we could add simple helpers mixins:

/// Mixin to set the background color.
///
/// @group utils
///
/// @param {color} $color - The background color. Note: This can only be a
/// variable from the color schema.
@mixin bg-color($color) {
  background-color: get-color($color);
};

/// Mixin to set the text color.
///
/// @group utils
///
/// @param {color} $color - The text color. Note: This can only be a
/// variable from the color schema.
@mixin text-color($color) {
  color: get-color($color);
};

2 robbar

Yeah that is a good idea, only the syntax should be as short as possible.
get-color should be color() and it can be placed as a shortcut in shortcuts.scss.
In shortcuts that color function should use the mg shortcut and the check
@if map-has-key($color-scheme, $color) { should be in the mg function
๐Ÿ‘ for color shortcut
๐Ÿ‘Ž for the text-color bg-color because there is no added value here, correct me if there is an advantage. With this we introduce 3 lines of code in the baserepo to output one-line of css. This feels like overkill.

a background color or color can just be.

background-color: color(name);
color: color(name);

3 sqndr

๐Ÿ‘

Let's leave the mixins out. Valid reasoning!

Classes for placing margins and paddings

@for $i from 1 through 5 {
 .ml#{$i} {
   margin-left: rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .mt#{$i} {
   margin-top: rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .mr#{$i} {
   margin-right: rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .mb#{$i} {
   margin-bottom: rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .pl#{$i} {
   padding-left: rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .pt#{$i} {
   padding-top: rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .pr#{$i} {
   padding-right: rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .pb#{$i} {
   padding-bottom: rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .hor-p#{$i} {
   padding: 0 rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .ver-p#{$i} {
   padding: rh(.2 * $i) 0;
 }
}

@for $i from 1 through 5 {
 .hor-m#{$i} {
   margin: 0 rh(.2 * $i);
 }
}

@for $i from 1 through 5 {
 .ver-m#{$i} {
   margin: rh(.2 * $i) 0;
 }
}

add modernizr and add favicon generator

The config file still holds the settings for favicon and modernizr, these gulp tasks can be transfered from ocelot to jacket. This is not drupal 7 related.

Do minification without all the advanced changes css

We use the gulp-css-min plugin which uses clean-css.
https://github.com/jakubpawlowicz/clean-css
This clean css comes out of the box with some advanced cleanup settings turned on.

These advance settings do more than just minify your code, they do property merges and selector merges. When you have bad css that is a good thing LoL.

But this is actually a very bad thing,
these advance settings introduces differences in your css cross env when you only run this minification on prod envs!

When your css is written in the correct way you should not need these advance settings anymore.
We also have our scss linter to back us up here.
With this peace of code we deactivate this advanced cleaning:

.pipe minifyCss(advanced: false)

I created an issue in their repo for this: clean-css/clean-css#717

Remove the weird breakpoints path in Neat.scss

Should be:

-@import "../../../../breakpoints.json";
+@import "breakpoints.json";

And then we should provide a path from the include paths for this that is bound to the root.

The generator branch already tackles this issue, mainly this is an issue when the config files are stored at the root en the theme files somewhere deeper in the project structure.
This is the includespath array in the gulpfile in the generator.

@@ -67,7 +67,8 @@ gulp.task("sass", "Compiles your SCSS files to CSS", function () {
         require("node-bourbon").includePaths,
         require("node-neat").includePaths[1],
         require("node-normalize-scss").includePaths,
-        config.path.bower + config.path.fontAwesome
+        "<%= dest %>/" + config.path.bower + config.path.fontAwesome,
+        "<%= dest %>"
       ],

Make the classes stronger by looping over the breakpoints array from the json file

in _grid.scss

$grids: (1, 2, 3, 4, 5, 6);
@each $i in $grids {
  .grid-#{$i} {
    &.mobile {
      @include media(med(mobile)) {
        @include grid($i);
      }
    }

    &.tablet {
      @include media(med(tablet)) {
        @include grid($i);
      }
    }

    &.desktop {
      @include media(med(desktop)) {
        @include grid($i);
      }
    }
  }
}

to something like this:

$grids: (1, 2, 3, 4, 5, 6);
@each $i in $grids {
  .grid-#{$i} {
    //for that loops over the keys in the breakpoints sass-map
  }
}

rem-with-px-fallback to false

/// Set to true to add a px fallback when using rems
//// @group Typography
//// @type Boolean
$rem-with-px-fallback: true;

Should be set to false. This is legacy.

Convert to neat 2

This is already in progress together with the update of the node modules.
It's a matter of changing the variables to the neads of the neat 2 lib

Hide and show classes mixed with breakpoints.

Provide .hide and .show classes.
And in conjunction with that provide .hide@breakpoint and show@breakpoint classes.
Then you can do something like:

<div class="hide show@tablet">
or
<div class="show hide@desktop">

Remove duplicate old base font sizes.

/// Rembase variable
//// @group Typography
//// @type Value
$rembase: 16;

/// Base font size in px
//// @group Typography
//// @type Value
$base-font-size: 15px;

/// Base line height in px
//// @group Typography
//// @type Value
$base-line-height: 25px;

the $base-font-size is the only one that should be used.
Als this should be set to 16px.

$rembase: 16; should be removed
and

/// Set the font-size with a px fallback
//// @group Typography
/// @param {value} $size [none] - font-size
/// @param {unit} $unit [rem] - unit used for font-size
@mixin font-size($size, $unit: rem) {
  @if $rem-with-px-fallback == true {
    font-size: $size + px;
  }

  font-size: $size / $rembase + $unit;
}

/// Set the line-height with a px fallback
//// @group Typography
/// @param {value} $line-height [none] - line-height
/// @param {unit} $unit [rem] - unit used for line-height
@mixin line-height($line-height, $unit: rem) {
  @if $rem-with-px-fallback == true {
    line-height: $line-height + px;
  }

  line-height: $line-height / $rembase + $unit;
}

Should use $base-font-size instead of rembase.

Review comments on 5 main files...

for example:

// ====================================================================================================== //
// BASE-STYLES.SCSS //
// Uses the imports file and imports the base styles in the right order
// ====================================================================================================== //

Is not really actual(no more imports file) and should contain some tekst to explain base styles

Adjust the sassdoc task

  • options should not be as a var.
  • change the path to use the config /assets does not exist anymore.
    And make sure scss is scr/scss in config.path and that it gets appended with the right string "/**/*" in the gulp file

Review the helper classes based on BEVM

BEVM: Block__element--modifier -variation

The helper styles we now have like bgc-#{color} for example is thus a variation.
They should be prefixed with a - sign so the variation is -bgc-red for example.
It's more clear we are talking about helper/variations with the - sign.

But! We should agree that the -variation applies on everything, so -dib (display: inline-block) can go on every component/tag for example.

A problem I have encountered with this decoupled variation approach is that it needs a important statement to override the component styles. No really big issue, but we should keep that in mind, the component style selector will be stronger then the -variation one.

With tags and base styling this is no problem at all, for example
<h1 class="-c-red">test</h1>

h1 {
  color: grey;
}
.-c-red {
  color: red;
}
/* the h1 will be red without important */

Another problem is that there should still be modifiers attached to the component.
I understand that class="btn btn--green btn--large btn--underlined" is too much btn :)

But there should be a difference between variation and modifier so my suggestion is to still use,
something like this class="btn --green --large --underlined -dib -c-red"

--class applies to this component only
-class applies to all tags

With this approach we get the whole shebang :D
No component name clutter, -variation for all tags, --modifiers for components.
๐Ÿ‘

Pull css minification away form the standard sass task

The sass task now minifies the css .pipe(mincss())
but this should be bundled in the improve task and made separate.

It is more consistent,
and it can be easier to inspect the plain css code to spot errors.
If you do want the css to be expanded you can just run gulp compile (the grouped task without the improve this will expand the css).

There can also be a difference in output css on dev/stage and prod.
Easier to debug and view the raw css files when bugs appear.

I know sourcemapping got us covered, but there are edge cases where you do want to look at the compiled css expanded. Debuggers like the ie9 debugger do not cover sourcemapping, I see an advantage there as well. Do not get me wrong, the standard gulp task will still minify the css, but it will be done in another separated step. Maybe we'll lose some milliseconds, but that is a minor issue since we win on flexibility.

components double

// Components styles
@import "components/**/*";
should be
// Components styles
@import "components/*";

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.