CMS Development

peesen
Mitwirkender/Mitwirkende

Upload SASS-Files

lösung

Hello, is it still not possible to upload SASS-Files to the HubSpot-Designer (also via HubSpot CLI)? I would like to host the CSS and the SCSS Files on HubSpot. Thank you so much and best regards. Pascal

0 Upvotes
2 Akzeptierte Lösungen
dennisedson
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

Upload SASS-Files

lösung

Hi @peesen , Not at this time.

I would recommend using a version control system and host your files on GitHub or the like.

Lösung in ursprünglichem Beitrag anzeigen

pixl_labs
Lösung
Mitwirkender/Mitwirkende

Upload SASS-Files

lösung

My team and I do it like this.

We use the HubSpot CLI to work locally. Keep all our SCSS as any other local project.

Screen Shot 2021-03-21 at 21.26.19.png

We then run it through gulp.

 

 

 

const gulp = require('gulp');
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');

const paths = {
   src: './scss/main.scss',
   dest: './PATH/css'
}

function compile() {
  return gulp.src(paths.src)
    .pipe(sass().on('error', sass.logError))
    .pipe(autoprefixer())
    .pipe(gulp.dest(paths.dest));
}

function watchForChanges() {
  gulp.watch('./scss/*/**.scss', compile);
}

exports.compile = compile;
exports.watch = watchForChanges;

 

 

 

 

Then you can import your main.css.
 

If you want to do individual modules. Create a modules folder in SCSS/SASS and don't put it as a partial. Then change the paths on your gulp file. Let it create a your-module.css on compile. Then require it in your module html.

 

 

 

<div> YOUR MODULE HTML </div>

{{ require_css(get_asset_url("PATH/your-module.css")) }}

 

 

 

 

Then we keep our whole repository on Github for version control. 

Hopefully that helps!

 

hubspot-community-signature.png
Joshua Todd |  CEO of Pixl Labs
www.pixllabs.io

Lösung in ursprünglichem Beitrag anzeigen

3 Antworten
pixl_labs
Lösung
Mitwirkender/Mitwirkende

Upload SASS-Files

lösung

My team and I do it like this.

We use the HubSpot CLI to work locally. Keep all our SCSS as any other local project.

Screen Shot 2021-03-21 at 21.26.19.png

We then run it through gulp.

 

 

 

const gulp = require('gulp');
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');

const paths = {
   src: './scss/main.scss',
   dest: './PATH/css'
}

function compile() {
  return gulp.src(paths.src)
    .pipe(sass().on('error', sass.logError))
    .pipe(autoprefixer())
    .pipe(gulp.dest(paths.dest));
}

function watchForChanges() {
  gulp.watch('./scss/*/**.scss', compile);
}

exports.compile = compile;
exports.watch = watchForChanges;

 

 

 

 

Then you can import your main.css.
 

If you want to do individual modules. Create a modules folder in SCSS/SASS and don't put it as a partial. Then change the paths on your gulp file. Let it create a your-module.css on compile. Then require it in your module html.

 

 

 

<div> YOUR MODULE HTML </div>

{{ require_css(get_asset_url("PATH/your-module.css")) }}

 

 

 

 

Then we keep our whole repository on Github for version control. 

Hopefully that helps!

 

hubspot-community-signature.png
Joshua Todd |  CEO of Pixl Labs
www.pixllabs.io

peesen
Mitwirkender/Mitwirkende

Upload SASS-Files

lösung

@pixl_labs  Hey Josh, thank you so much. We are a group of developers and now changed from the HubSpot Designers to local Development. Now we have the problem, that we can not work like this with SASS because the local SASS-Files are always different. How can we manage, that we all have the same SASS Files all the time in the team? I started thesting with GitHub Desktop.

dennisedson
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

Upload SASS-Files

lösung

Hi @peesen , Not at this time.

I would recommend using a version control system and host your files on GitHub or the like.