Skip to main content

CLI for the Titus CSS toolkit; it generates the base CSS files.

Project description

Titus CLI

Titus-logo

Titus is a toolkit composed by a CSS template system, a theming tool and a developer companion, targeted to the CSS artisan that likes to work by hand, with full control over the code, without sacrificing simplicity and ease of use.

This is the CLI tool that will generate the Titus CSS system files for any kind of frontend project that uses CSS.

Features

  • Generate CSS theme files with a predefined structure.
  • Define and manage CSS variables and templates.
  • Automatically generates a complete CSS system with:
    • a CSS reset (the classic http://meyerweb.com/eric/tools/css/reset/);
    • absolute and relative general sizes;
    • absolute and relative font sizes;
    • a fully fledged five colors palette, with tints and shades for every color, based on the user's main color input;
    • a border, shadows and breakpoints pre-established system.
  • And more, very soon!

Requirements

The Titus CLI tool is distributed as a Python package, and it requires Python 3.8 or upwards. It is designed to work in combination with the Visual Studio Code Extension Titus Companion, which greatly improves the developer experience by providing a keyboard shortcut to easily enter Titus variables.

Installation

Install the Titus CLI by downloading it from the Python Package Index:

pip install titus-cli

or

pip install --user titus-cli

The difference between pip install and pip install --user is primarily where the Python packages are installed: pip install installs the package globally for the entire system, and pip install --user Installs the package for the current user only, without needing administrative permissions. pip install --user provides an isolated and safer installation method for personal use without affecting the global environment.

Usage

Once installed in the system, go to the target folder in which the main CSS files for the project will be: usually, these are named styles, stylesheets, css, or similar. Once there, enter:

titus init

You will be prompted for a main color, and Titus will generate a full CSS system based on that input.

Then, import the reset.css and titus-system.css files from your other CSS files:

@import(reset.css);
@import(titus-system.css);

You can also add them via HTML tags, or using import in a React application, e.g.

Using the Titus system along the Companion in Visual Studio Code gives access to the full power of Titus by pressing shift + f7, making much easier to enter Titus variables names. Please, read the following section.

Variable codes

This is an example of how a Titus variable looks like:

:root {

  --TITUS-srA: calc(1rem * 0.25);

}

Each Titus variable is formed by:

  • The necessary double slash --
  • A TITUS prefix to differentiate it from other variables
  • A single slash - that separates the prefix from the variable code
  • A variable code. In this example, it's sr, for Size Relative. Each type of variable has its own code. For instance, s for absolute sizes (--TITUS-sH), or mc for the Main app Color
  • An uppercase letter. In this example, A. This letter indicates the scale or intensity, where A is the minimum and Z the maximum. In the Titus color system, it refers to the lightness: letter E corresponds to the base color, A to the lightest tint, and N to the darkest shade.

Reference

Quick Reference Table

Category Variable Code Example
General Absolute Sizes s --TITUS-sA
General Relative Sizes sr --TITUS-srA
Absolute Font Sizes f --TITUS-fA
Relative Font Sizes fr --TITUS-fr
Font Weights* fw --TITUS-fwt
Main Color mc --TITUS-mcA
Complementary Color cc --TITUS-ccA
Accent Color #1 ac1 --TITUS-ac1A
Accent Color #2 ac2 --TITUS-ac2A
Accent Color #3 ac3 --TITUS-ac3A
Accent Color #4 ac4 --TITUS-ac4A

*Font Weight Scale:

  • wt: 100, Thin
  • wel: 200, Extra Light
  • wl: 300, Light
  • wn: 400, Neutral
  • wm: 500, Medium
  • wsb: 600, Semi Bold
  • wb: 700, Bold
  • web: 800, Extra Bold
  • wbl: 900, Black

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

titus_cli-0.1.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

titus_cli-0.1.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file titus_cli-0.1.1.tar.gz.

File metadata

  • Download URL: titus_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for titus_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b0ebec3f325ef876cc79eef6bb1e76d7147305d56638c3eb7452d6afd44df898
MD5 cf40efafee173fd45eb5b591aa784478
BLAKE2b-256 1f28b9e3f278041c6cf4c45076c3dd0866693372d6a9943967d3b875ac2c5f0c

See more details on using hashes here.

File details

Details for the file titus_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: titus_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for titus_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee0fe0d7e967ecb6a3fff8bd25110ff75c01975e5b3a1f4e4e9498b4508076c4
MD5 e366927cfff89d240c817f82f1d701ee
BLAKE2b-256 f63eff4bd3eb87deabeb93d9c08d722fdf209f036e0dd8417afcd48a7a5bacf0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page