GithubHelp home page GithubHelp logo

stadgent / fractal_styleguide_gent-base-archive Goto Github PK

View Code? Open in Web Editor NEW
3.0 5.0 2.0 2.75 MB

Archive for the styleguide for sites made by city of Ghent.

Home Page: https://stijlgids.stad.gent/

License: GNU General Public License v3.0

JavaScript 11.00% CSS 36.64% HTML 50.32% Shell 1.95% Ruby 0.09%
styleguide fractal ghent d09crmcheck22 d09check22 web

fractal_styleguide_gent-base-archive's Introduction

Styleguide Gent Base

This style guide contains the SASS library and needed assets to be able to style a web application in the corporate identity for the city of Ghent..

NPM version Downloads License

Build Status Maintainability

Roadmap

Style guide version 3.x

  • A major overhaul with an entirely new style for all components.
  • Probably a full CSS grid implementation throughout all the style guide components.
  • We will probably drop jQuery in favor for native Javascript or another.

Upcoming: 2.7.x

  • General changes and fixes to the style guide.

Licenses

If you are building something for the City of Ghent (Stad Gent) or Digipolis, you can contact the web team at Digipolis or open an issue here to get the necessary licenses thar are required for your project. For more info on what licenses you need see below.

License: Expressway font

The Expressway font is a paying font used by the style guide of the City of Ghent. It needs to be included through Typekit.

License: Light Gallery plugin for jQuery

It is important to note that anyone that wants to use this style guide or fork this repository for commercial purposes, should pay for a license!

Folder structure

When installing this package, you will get a directory structure like this.

.
├── CHANGELOG.md
├── LICENSE
├── README.md
├── build
│   └── styleguide
│       └── sass
└── package.json

The build directory contains all SASS source files and all asset files needed to be able to style a web application in the corporate identity for the city of Ghent..

Implementing this style guide in your own project

This style guide aims to be technology independent. This means you should be able to use it inside your project with any technology you want. It utilizes SASS to style its components, so you will have to use that in your project.

Setup

After installing the style guide through npm install gent_styleguide you''ll get a folder structure like this:

.
├── node_modules
│   └── gent_styleguide
│   └── breakpoint-sass
├── package-lock.json
└── package.json

Now, to use the style guide SASS partials you just need to import them into your main SASS file at the top so they get loaded before your own code.

@import 'node_modules/gent_styleguide/build/sass/00-settings/reset';
@import 'node_modules/gent_styleguide/build/sass/00-settings/vars';
@import 'node_modules/gent_styleguide/build/sass/01-mixins/**/*';
@import 'node_modules/gent_styleguide/build/sass/11-base/**/*';
@import 'node_modules/gent_styleguide/build/sass/21-atoms/**/*';
@import 'node_modules/gent_styleguide/build/sass/31-molecules/**/*';
@import 'node_modules/gent_styleguide/build/sass/41-organisms/**/*';

Note: we use this structure to allow you to override anything you wish in your own custom project. The way to do this, is to add the imports above to your main SASS file and add imports of your own overriding files in between.

If you don't need to be able to change the molecules for your project and instead just want to import the style guide and use it as it is, you can use the main.scss file instead of using the following approach.

Example:

@import 'node_modules/gent_styleguide/build/sass/00-settings/reset';
@import 'node_modules/gent_styleguide/build/sass/00-settings/vars';
@import '/sass/00-vars-overrides/**/*';
@import 'node_modules/gent_styleguide/build/sass/01-mixins/**/*';
@import '/sass/01-mixins-overrides/**/*';
@import 'node_modules/gent_styleguide/build/sass/11-base/**/*';
@import '/sass/11-base-overrides/**/*';
@import 'node_modules/gent_styleguide/build/sass/21-atoms/**/*';
@import '/sass/21-atom-overrides/**/*';
@import 'node_modules/gent_styleguide/build/sass/31-molecules/**/*';
@import '/sass/31-molecule-overrides/**/*';
@import 'node_modules/gent_styleguide/build/sass/41-organisms/**/*';
@import '/sass/41-organism-overrides/**/*';

Note: When using the style guide you will need to add breakpoint-sass as an includePath inside your gulpfile.js

Example:

    .pipe(sass({
      outputStyle: 'compressed',
      includePaths: ['node_modules/breakpoint-sass/stylesheets']
    })).on('error', sass.logError)

This includePaths path may vary depending on your setup!

Fonts

You need to make sure the Expressway font is included in your project somehow. This would be done by including the Typescript script in your project and requesting a license / Typekit kit from the web team at Digipolis.

Example:

<script>
  (function(d) {
    var config = {
          kitId: 'kgt4wbp',
          scriptTimeout: 3000,
          async: true
        },
        h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+"wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+="wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
  })(document);
</script>

So in this example you would need to change the kitId to the ID you got from the web team of Digipolis.

Third party support

AngularJS CLI support (no SASS globbing)

We provide a main_cli.scss file that is essentially the same as main.scss, but includes all SASS partials the style guide needs without SASS globbing.

IMPORTANT

We recommend using the main_cli.scss file only when you need to support Angular CLI.

fractal_styleguide_gent-base-archive's People

Contributors

daften avatar delrueba avatar dependabot[bot] avatar fraukevdz avatar jelle-s avatar jeroen005 avatar johanraes avatar meirege avatar wim-vantomme avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fractal_styleguide_gent-base-archive's Issues

Support for Angular CLI

The main.scss file uses import globbing statements, which is, by default, not supported for use with Angular CLI. Is it possible to create a main_cli.scss file with all the necassary references without globs?

Environment

  • Version used: 2.7.0
  • Project: Digitale Front Office Inname Publieke ruimte

Proposition: Using a grid system like Susy.

Just an idea:
Using a grid system like Susy allows for better semantics. It also removes a lot of divs Bootstrap needs to define a grid. No more row wrappers are needed etc...
It generally makes the HTML cleaner.

Restructuring of the current style guide.

I propose we change the structure of the style guide to the following:

By defining components and their variants in their own twig files we can start to reuse these components in other components with more ease, which allows us to better keep the style guide up to date and allows for better Drupal 8 integration in the future.

Some things to refactor:

  • Give each component it's own handle name (defined in the component config file) for easier referencing in other components.
  • Create templates to show of groups of components or entire pages as an example for people who want to integrate the style guide in their app.
  • Make references to other components with the following syntax: {% include ‘@text-styles’ %}.
  • Rename component subfolders and use the order key in their config files to define the Fractal navigation order.

Some references, inspiration:

Links inside h-tags should get styling

Currently when a h-tag (h1,... h6) contains a link it will be styled as a link...
This should be part of the heading atoms imo, that when they contain a link, they should style that link the same way as the heading atom it is in.

NPM installation fails

The installation of the package over npm still fails due to the postinstall script.
Can you please fix this?

Changing the way sections define atoms and molecules.

I propose a different approach on how we should let sections define theming for atoms, molecules and organisms.

In this article there is a section called "The block mixin approach".

The idea is that they use a SASS map where they define the colors that themes should override.
They also use a mixin themify() that automatically creates the CSS that components need based on a wrapper class (e.g. the section it's contained in).

This would let us create atoms, molecules and organisms without having to manually change code in the new-sections() mixin each time, thus removing duplicate code and making it easier to maintain the style guide.

It would then be the responsibility of the developer to include the themify() mixin for all properties of a component that need different theming based on the section they are in.
But once this is implemented, the code for all theme variations for that component would be compiled automatically by SASS.

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.