Git Product home page Git Product logo

silverstripe-simple-styleguide's Introduction

Simple Styleguide Module

The Simple Styleguide enables site maintainers a single page to source the general site styles out of the box (typography, links, colours, form fields etc). Extensible through theme templates to build out a component library specific to the website.

Build Status codecov Scrutinizer Code Quality

Overview

The module adds a new controller endpoint which can be viewed at the /_styleguide route, if logged in with admin permissions, or viewing from a dev environment. Also provides a kitchen sink template that can be used or overriden by your site theme to display frontend and typography components.

The SimpleStyleguideController class also includes a basic form (SimpleStyleguideController::TestForm()), and HTMLText output (SimpleStyleguideController::getContent()), for testing framework output.

Installation

Run on the command line:

$ composer require benmanu/silverstripe-simple-styleguide

or include "benmanu/silverstripe-simple-styleguide": "^2.0" in your project composer.json and run:

$ composer update

Use the 1.0 tag for SilverStripe 3 sites.

Usage

The styleguide template can be overriden by including a SimpleStyleguideController.ss file in your themes template/Layout/ directory.

The SimpleStyleguideController class can be overriden using SilverStripes extensions to either add new output functions, or modify the provided functions, by using the updateStyleguideData extension hook.

Styleguide Data

An extension hook is available to override/edit the rendered template data through updateStyleguideData.

Color Swatches

A simple color swatch template is available and can be overriden through the color_swatches config value.

BenManu\SimpleStyleguide\SimpleStyleguideController:
  color_swatches:
    - Name: "Black"
      Description: "This color is rather dark"
      CSSColor: "#000000"
      TextColor: "#ffffff"
    - Name: "Grey"
      Description: "This color is grey"
      CSSColor: "#666666"
      TextColor: "#000000"

Placeholder Images

The placeholder image url can be overriden through the placeholder_image_url config.

BenManu\SimpleStyleguide\SimpleStyleguideController:
  placeholder_image_url: "/simple-styleguide/images/placeholder.png"

silverstripe-simple-styleguide's People

Contributors

benmanu avatar chillu avatar lexakami avatar maxime-rainville avatar pjayme avatar wilr avatar

Stargazers

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

Watchers

 avatar

silverstripe-simple-styleguide's Issues

Fixtures

Would be good to have a way to include content blocks, and defined fixtures

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.