GithubHelp home page GithubHelp logo

Need help to use Typey about typey HOT 5 CLOSED

webmasterpf avatar webmasterpf commented on July 28, 2024
Need help to use Typey

from typey.

Comments (5)

jptaranto avatar jptaranto commented on July 28, 2024

If you are using gulp-sass then you're on libsass already. Have you looked into using Eyeglass? It's what I would recommend here. Just add it as a dependency in npm, and then adjust your gulp task so it's calling eyeglass, instead of gulp-sass. You'll get typey automatically then without having to specify include paths just by using @import 'typey';

If you don't want to go to all that trouble, I would look at your include paths. Are you getting a 'typey' not found error? To test typey you can do something really simple like font-size: font-size(12px).

You'll want to specify any variable overrides in your application.scss as per the (somewhat limited) documentation in the repos readme. Otherwise have a look at the variables file inside stylesheets/typey/_defaults.scss.

from typey.

pryley avatar pryley commented on July 28, 2024

@webmasterpf Something like this:

gulpfile.js

var gulp           = require( 'gulp' );
var autoprefixer   = require( 'gulp-autoprefixer' );
var cssnano        = require( 'gulp-cssnano' );
var gulpif         = require( 'gulp-if' );
var sass           = require( 'gulp-sass' );
var moduleImporter = require( 'sass-module-importer' );
var args           = require( 'yargs' ).argv;

/* CSS Task
 -------------------------------------------------- */
gulp.task( 'css', function ()
{
    return gulp
        .src('src/scss/*.scss')
        .pipe( sass({
            importer: moduleImporter(),
            outputStyle: 'expanded'
        }).on( 'error', sass.logError ))
        .pipe( autoprefixer() )
        .pipe( gulpif( args.production, cssnano({
            discardComments: { removeAll: true }
        })))
        .pipe( gulp.dest( 'assets/css' ))
});

// ...

SASS file:

@import "typey";

from typey.

webmasterpf avatar webmasterpf commented on July 28, 2024

@jptaranto I had an error with my path to typey and I think doing fix it now :

var basePaths = {
    src: './sass/**/*.scss', // fichiers scss à surveiller
    dest:  './css/', // dossier à livrer
    node_modules: './node_modules/',
    gems:'/home/webmaster/vendor/bundle/gems/'
};

and other path variables, originally designed to separate gems from node modules,

var assetsPath = {
  gems: [
    basePaths.gems + 'susy-2.2.2/sass',
    basePaths.gems + 'breakpoint-2.7.1/stylesheets',
    
    basePaths.node_modules +  'typey/stylesheets'
  ],
   node_modules: [
       //Ajoutés avec les gems pour simplifier     
       
  ],
  javascript: [
    '',
       
  ]
};

and my task, can I use multiple path as includePath like I would ?:

gulp.task('sasscompil', function () {
    return gulp.src(basePaths.src)
            .pipe(plugins.sourcemaps.init())
            .pipe(plugins.sass({
                noCache: true,
                bundleExec: true,
                includePaths: [].concat(
                        assetsPath.gems,
                        assetsPath.node_modules,
                        folderPaths.styles.src
                        ),
                sourceMap: true,
                outputStyle: 'compressed'
                
            })...

from typey.

webmasterpf avatar webmasterpf commented on July 28, 2024

Changing paths like this:
in application.scss:
@import './node_modules/typey/stylesheets/_typey.scss';

in gulpfile.js:
basePaths.node_modules + 'typey/stylesheets/_typey.scss'

:/

from typey.

webmasterpf avatar webmasterpf commented on July 28, 2024

Ok fix my issue by modifying the path in @import like this :
@import '../node_modules/typey/stylesheets/_typey.scss';
and use mixin like it does:

h2 {
    	@include font-size(m);
	}

👍

from typey.

Related Issues (7)

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.