GithubHelp home page GithubHelp logo

manrriquez / scalable-starter-boilerplate-manrriquez Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 836 KB

Starter scalable boilerplate with Bootstrap 5 | ES6 | Gulp | SMACSS | SASS | Jquery | AOS Animation | Slick Slider by @Manrriquez

License: MIT License

JavaScript 3.59% SCSS 86.18% CSS 9.44% HTML 0.79%
boilerplate-front-end boilerplate-template bootstrap bootstrap5 es6 gulp gulp-tasks sass sass-boilerplate smacss

scalable-starter-boilerplate-manrriquez's Introduction

SCALABRE STARTER BOILERPLATE

Contributors Forks Stargazers Issues MIT License LinkedIn


Initial Template based on the Scalable and Modular Architecture for CSS (SMACSS), Blocks, Elements and Modifiers (BEMCSS), and Syntactically Awesome Style Sheets (SASS) projects. Regardless of the size of your project, this organization pattern combined with BEM can further streamline and speed up the development and maintenance of your code.

Styles are divided into the following groups: Base, Layout, Shame, Modules, Responsive, States, Utilities e Pages

About the template

Product Name Screen Shot

Why use SMACSS ??

Scalable and Modular Architecture for CSS (SMACSS), It is not a framework or library, but rather a guide to structure styles in an intelligent and scalable way. Regardless of the size of the project, this organizational pattern combined with BEM can further streamline and speed up the development and maintenance of your code.

Why use BEM with Bootstrap?

The Block Element Modifier (BEM) is a naming convention for CSS selectors created by Yandex developers. It makes it easy to understand the function of a certain CSS selector simply by analyzing its name. Great for team work. Maintenance is facilitated even after a long time without contact with the code. Small changes do not affect what has already been implemented, reducing the chance of bugs.

The purpose of using Bootstrap is to use as little Sass as possible, but still have everything available. However, there are cases where Bootstrap will not be enough and we will have to use Sass. By doing this, we can take advantage of using BEM, standardizing these exceptions and bringing an intuitive and standardized code.

Example below using BEM in conjunction with Bootstrap:

<section class="home">
   <div class="container">
     <div class="row">
        <div class="col-12">
           <div class="home__box">
              <div class="home__box__content">
                   <h1>Hello World</h1>
              </div>
           </div>
        </div>
      </div>
   </div>
</section> 
.home {
  &__box {
    box-shadow: 0 1px 2px rgb(223 3 3 / 50%);
    
    &__content {
      padding: 15px;
    }
  }
}

How to best use Bootstrap?

Bootstrap entered the market as a CSS framework, focused on components, unlike Tailwind, which is utility-first, focused on utilities. This way, Bootstrap comes pre-defined with components, colors, fonts, and styles. Many don't know, but Bootstrap offers source files for download to be used in your own way.

It is recommended that you only change the _variables.scss file, as from the variables you can have the autonomy to change, for example, text-primary, bg-secondary to colors of your choice. There are countless possibilities for how to customize Bootstrap to your liking!

As the default Bootstrap/Sass standard:

As a standard of Bootstrap, it comes set in this way, so that each component is guided by these variables. But what if we could change it in our own way?

// Variables
// Color system

// scss-docs-start theme-color-variables
$primary:       $blue !default;
$secondary:     $gray-600 !default;
$success:       $green !default;
$info:          $cyan !default;
$warning:       $yellow !default;
$danger:        $red !default;
$light:         $gray-100 !default;
$dark:          $gray-900 !default;
// scss-docs-end theme-color-variables

After changing the _variables.scss file:

After changing the $primary variable to #e6381f, every time you call a pre-defined class such as text-primary or bg-primary, it will automatically use the hexadecimal color we set to #e6381f by default. This applies to colors, fonts, sizes, etc. The possibilities are endless!

// Variables
// Color system

// scss-docs-start theme-color-variables
$primary:       #e6381f !default;
// scss-docs-end theme-color-variables

Directory Structure

┌── .gitignore
├── assets
│   ├── img
│   ├── js
│   ├── sass
│        ├── base
│        │   ├── _base.scss
│        │   ├── _root.scss
│        │   └── _index.scss
│        │
│        ├── layout
│        │   ├── _header.scss
│        │   ├── _footer.scss
│        │   ├── _main.scss
│        │   └── _index.scss
│        │
│        ├── pages
│        │   ├── _home.scss
│        │   ├── _privacy-policy.scss
│        │   ├── _use-cockies.scss
│        │   └── _index.scss
│        │
│        ├── modules
│        │   ├── components
│        │   │   ├── _boxes.scss
│        │   │   ├── _buttons.scss
│        │   │   
│        │   └── _index.scss
│        │
│        ├── states
│        │   └── _boxes.scss
│        │   ├── _list.scss
│        │   ├── _index.scss
│        │
│        ├── utilities
│        │   ├── _keyframes.scss
│        │   ├── _transforms.scss
│        │   ├── _transitions.scss
│        │   └── _utilities.scss
│        │   
│        ├── responsive
│        │   ├── _tablet.scss
│        │   ├── _mobile.scss
│        │   └── _index.scss
│        │
│        ├── shame
│        │   └── _overrides.scss
│        │ 
│        ├── main.scss
│
├── README.md
├── README-PT.md
├── .gitignore
├── .gulpfile.js
├── package.json
├── LICENSE.txt
├── index.html

Rewriting components the right way:

Do you know that embarrassing thing we have to do sometimes? Be it a component created by you or something ready from bootstrap? Well, this file in particular is directed towards exactly this! The infamous and controversial !important, and for this the _overrides.scss fulfills its promise.

  1. Rewriting Bootstrap component:
.form {
    border: none!important;

    input:focus {
        border-color: #86b7fe!important;
    }

}

Gulp:

Using Gulp saves a lot of time. By using Gulp, you will no longer perform tedious tasks that have become the responsibility of your Operating System, such as: Compiling Sass files to CSS. Concatenation (combination) of several JavaScript files, file renaming, file minification, and a sea of possibilities for you to venture into!

  1. Examples of production and development tasks and when to use them:

1.1 Development task, should be used in the development environment for testing, refactoring, where this task has the goal of expanding the minified file for better readability, in the moment of finding that notorious bug!.

// To run this task, type the following in the root project terminal: 'gulp sassdev'
gulp.task('sassdev', function() {
  return gulp.src(scssFiles)
    .pipe(sass(sassDevOptions).on('error', sass.logError))
    .pipe(gulp.dest(cssDest));
});

1.2 Development task should be used during the development stage for testing, refactoring, with the aim of expanding the minified file for better readability when finding a bug. Production task should be used at the decisive moment when we are about to make the final release, for whichever server it may be. This task has the goal of minifying the file, converting Sass to CSS. That's right, you read that correctly, small dev! No more tedious tasks, leave it to Gulp to handle it for you. Beyond just minifying and converting, it redirects the minified and converted file to the css/main.css folder, isn't that wonderful!

// To run this task, type the following in the root project terminal: 'gulp sassprod'

gulp.task('sassprod', function() {
  return gulp.src(scssFiles)
    .pipe(sass(sassProdOptions).on('error', sass.logError))
    .pipe(rename('main.min.css'))
    .pipe(gulp.dest(cssDest));
});

Libs

Here I present you some pre-configured libraries starting from this template, below I highlight the main libraries of this theme and their examples of how to use them, which will influence the development of your project..

Slick Slider

Making a carousel will never be a problem again This small open source library (made available under the MIT license) created by Ken Wheeler (current director of open source at Formidable Labs, Inc) and now has over 21,000 stars on GitHub, makes creating a carousel extremely easy. The best part is that we don't have to sacrifice flexibility and customization. In short, it helps us without limiting us.

  1. create with slider and slick:

1.1

<div class="carousel">
  <div><img src="https://i.imgur.com/3aIutJi.png" alt="js" /></div>
  <div><img src="https://i.imgur.com/rWtGeQ0.png" alt="java" /></div>
  <div><img src="https://i.imgur.com/8946bSF.png" alt="python"/></div>
  <div><img src="https://i.imgur.com/9Hc7hjb.png" alt="kotlin" /></div>
  <div><img src="https://i.imgur.com/uZDEpjX.png" alt="scala" /></div>
  <div><img src="https://i.imgur.com/eQoyQjy.png" alt="C#" /></div>
  <div><img src="https://i.imgur.com/ko3iAbu.png" alt="PHP" /></div>
  <div><img src="https://i.imgur.com/Afkz5od.png" alt="dotnet" /></div>
</div>

1.2

$('.carousel').slick({
  dots: true,
  infinite: true,
  speed: 500,
  slidesToShow: 4,
  slidesToScroll: 4,
});

AOS Animation

AOS (Animate On Scroll) is a library that allows you to apply different types of animations on scroll to the elements (blocks, images, etc.) that make up your website.

  1. Creating and activating animations with AOS:

1.1

<div class="item" data-aos="fade-up">fade-up</div>
<div class="item" data-aos="fade-down">fade-down</div>
<div class="item" data-aos="zoom-in">zoom-in</div>
<div class="item" data-aos="zoom-out">zoom-out</div>
<div class="item" data-aos="slide-up">slide-up</div>
<div class="item" data-aos="flip-right">flip-right</div>
<div class="item" data-aos="flip-left">flip-left</div>

1.2

<script> 
    AOS.init(); 
<script>

🚀 To install the project, follow these steps:

Follow the steps below for the best template experience:

  1. Clone the project:
    git clone https://github.com/Manrriquez/scalable-starter-boilerplate-manrriquez.git

🔧 Follow these steps to start the project:

Follow the steps below for the best template experience

  1. Download the necessary dependencies:

    npm install
    
  2. Any changes in the project scss, type in the terminal at the root of the project:

    gulp
    

Bugs & Suporte

Developed and structured by @Manrriquez. If there are any errors or bugs, please contact me as soon as possible.

Reference links

Reference links used to structure this template, where everything was possible.

License

Distributed under the MIT license. See LICENSE.txt for more information.

Contact

Luis Fernando - @manrriiquez - [email protected]

Project Link: https://github.com/Manrriquez/scalable-starter-boilerplate-manrriquez

(Subir)

scalable-starter-boilerplate-manrriquez's People

Contributors

manrriquez avatar

Stargazers

 avatar

Watchers

 avatar

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.