• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    CSS
  • Created over 7 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A lightweight CSS framework that brings MacOS styled elements to Electron

Ion

A lightweight CSS framework that brings MacOS styled elements to Electron.

About

Ion was developed with the aim of bringing native MacOS elements and components, such as buttons, sidebars, search inputs, tabs, tables, icons, and toolbars, to HTML and CSS.

Ion is designed to be used specifically within an Electron application.

Getting Started

git clone https://github.com/lukakerr/ion.git

Folder Structure

ion/
├── README.md
├── index.html
├── dist/
│   ├── ion.min.css
│   └── fonts/
│   └── img/
├── src/
│   ├── ion.css
│   └── fonts/
│   └── img/

Demo

ion

Documentation

Title Bar

A title bar can either be normal, tall, inset, or all three combined. The title bar is used to drag the application.

Inside the bar div, there are 3 other main elements:

  • The buttons div which is the traffic light buttons in every application
  • The title div, which is the title of your application shown in the title bar
  • The search element, which is the search input
<div class="bar tall inset">
  <div class="buttons">
    <button></button>
    <button></button>
    <button></button>
  </div>
  <div class="title">ion</div>
  <input class="search" placeholder="Search">
</div>

Buttons

Buttons are commonly used in the bar tall div. Each button is located within a div with the class bar-buttons.

The bar-buttons div, lets you add as many buttons as you want to the title bar. These buttons must have the btn class, as well as another class to show an icon. Note: the left-open-big and right-open-big icons go next to each other, as back and forward buttons.

The bar-buttons div also has active and disabled classes which make a button active or disabled.

To have a space between buttons, simply add the space class to a button.

To have a dropdown icon, add the dropdown class to a button.

<div class="bar-buttons">
  <button class="btn left-open-big"></button>
  <button class="btn right-open-big"></button>
  <button class="btn cog"></button>
  <button class="btn folder disabled"></button>
  <button class="btn info space"></button>
  <button class="btn reply active"></button>
  <button class="btn download"></button>
  <button class="btn login"></button>
  <button class="btn home"></button>
</div>

You can also group buttons together, by putting them in a btn-group class, which goes inside the bar-buttons class.

<div class="btn-group">
  <button class="btn download"></button>
  <button class="btn login"></button>
  <button class="btn cog"></button>
  <button class="btn folder disabled"></button>
</div>

Tabs

To get a tab interface, place the following <div> inside the bar class. To add more tabs, simply add another <div> with the class tab inside the tabs class.

<div class="tabs">
  <div class="tab active">
    <span class="close"></span>
    Documents
  </div>
  <div class="tab">
    <span class="close"></span>
    Ion
  </div>
  <div class="tab">
    <span class="close"></span>
    School
  </div>
  <div class="tab">
    <span class="close"></span>
    Work
  </div>
  <div class="add">
  </div>
</div>

Sidebar

The sidebar div gets shown on the left side of the window. This is used to display a list of elements, similar to the Finder

A heading div will put a heading above a bunch of items

Each item div inside the items div, must have the class item, as well as another class that determines what icon is shown next to it. Below are all the possible items you can use (this includes coloured tags)

<div class="sidebar">
  <div class="heading">
    Favourites
  </div>
  <div class="items">
    <div class="item allmyfiles">
      All My Files
    </div>
    <div class="item icloud">
      iCloud Drive
    </div>
    <div class="item airdrop">
      AirDrop
    </div>
    <div class="item applications">
      Applications
    </div>
    <div class="item desktop">
      Desktop
    </div>
    <div class="item documents">
      Documents
    </div>
    <div class="item downloads">
      Downloads
    </div>
    <div class="item movies">
      Movies
    </div>
    <div class="item music">
      Music
    </div>
    <div class="item pictures">
      Pictures
    </div>
    <div class="item home">
      Luka
    </div>
    <div class="item laptop">
      Luka
    </div>
  </div>
  
  <div class="heading">
    Files
  </div>
  <div class="items">
    <div class="item folder">
      Folder
    </div>
    <div class="item file">
      File
    </div>
  </div>

  <div class="heading">
    Tags
  </div>
  <div class="items">
    <div class="item red">
      Red
    </div>
    <div class="item orange">
      Orange
    </div>
    <div class="item yellow">
      Yellow
    </div>
    <div class="item green">
      Green
    </div>
    <div class="item blue">
      Blue
    </div>
    <div class="item purple">
      Purple
    </div>
    <div class="item gray">
      Gray
    </div>
  </div>
</div>

Table

A table can be displayed by using the HTML table element with the class table. If you want each row to have alternating background colours, add the alt class as shown below.

You can also have disabled rows, and active rows as shown below

<table class="table alt">
  <tr>
    <th>Name</th>
    <th>Date Modified</th>
    <th>Size</th>
    <th>Kind</th>
  </tr>
  <tr>
    <td>ion.css</td>
    <td>Today 3:33 pm</td>
    <td>100 KB</td>
    <td>CSS</td>
  </tr>
  <tr class="disabled">
    <td>Controllers</td>
    <td>8 April 2017, 8:45 am</td>
    <td>--</td>
    <td>Folder</td>
  </tr>
  <tr class="active">
    <td>Holiday.png</td>
    <td>23 June 2017, 6:50 pm</td>
    <td>2 GB</td>
    <td>PNG Image</td>
  </tr>
  <tr>
    <td>user.rb</td>
    <td>Today 1:44 pm</td>
    <td>5.1 MB</td>
    <td>Ruby Source</td>
  </tr>
</table>

Path

To get a breadcrumb style path at the bottom of the window, use a <div> with the class of path. This is shown below

<div class="path">
  <span class="item laptop">Macintosh HD</span>
  <span class="item folder">Users</span>
  <span class="item home">Luka</span>
  <span class="item documents">Documents</span>
</div>

Full Page Example

<!DOCTYPE html>
<html>
<head>

  <title>Ion</title>
  <link href="dist/ion.min.css" rel="stylesheet">

</head>
<body>

  <div class="bar tall">
    <div class="buttons">
      <button></button>
      <button></button>
      <button></button>
    </div>
    <div class="title">Ion</div>

    <div class="bar-buttons">
      <button class="btn left-open-big"></button>
      <button class="btn right-open-big"></button>

      <div class="btn-group">
        <button class="btn layout"></button>
        <button class="btn menu active"></button>
        <button class="btn window"></button>
        <button class="btn list"></button>
      </div>

      <button class="btn list-add space dropdown"></button>
      <button class="btn dot-3 dropdown"></button>
      <button class="btn cog dropdown"></button>
      <button class="btn download space"></button>
      <button class="btn tag"></button>
    </div>

    <div class="tabs">
      <div class="tab active">
        <span class="close"></span>
        Documents
      </div>
      <div class="tab">
        <span class="close"></span>
        Ion
      </div>
      <div class="tab">
        <span class="close"></span>
        School
      </div>
      <div class="tab">
        <span class="close"></span>
        Work
      </div>
      <div class="add">
      </div>
    </div>

    <input class="search" placeholder="Search">
  </div>

  <div class="sidebar">
    <div class="heading">
      Favourites
    </div>
    <div class="items">
      <div class="item allmyfiles">
        All My Files
      </div>
      <div class="item icloud">
        iCloud Drive
      </div>
      <div class="item airdrop">
        AirDrop
      </div>
      <div class="item applications">
        Applications
      </div>
      <div class="item desktop">
        Desktop
      </div>
      <div class="item documents active">
        Documents
      </div>
      <div class="item downloads">
        Downloads
      </div>
      <div class="item movies">
        Movies
      </div>
      <div class="item music">
        Music
      </div>
      <div class="item pictures">
        Pictures
      </div>
      <div class="item home">
        Luka
      </div>
      <div class="item laptop">
        Luka
      </div>
    </div>
    
    <div class="heading">
      Files
    </div>
    <div class="items">
      <div class="item folder">
        Folder
      </div>
      <div class="item file">
        File
      </div>
    </div>

    <div class="heading">
      Tags
    </div>
    <div class="items">
      <div class="item red">
        Red
      </div>
      <div class="item orange">
        Orange
      </div>
      <div class="item yellow">
        Yellow
      </div>
      <div class="item green">
        Green
      </div>
      <div class="item blue">
        Blue
      </div>
      <div class="item purple">
        Purple
      </div>
      <div class="item gray">
        Gray
      </div>
    </div>
  </div>

  <table class="table alt">
    <tr>
      <th>Name</th>
      <th>Date Modified</th>
      <th>Size</th>
      <th>Kind</th>
    </tr>
    <tr>
      <td>ion.min.css</td>
      <td>Today 3:33 pm</td>
      <td>100 KB</td>
      <td>CSS</td>
    </tr>
    <tr class="disabled">
      <td>Controllers</td>
      <td>8 April 2017, 8:45 am</td>
      <td>--</td>
      <td>Folder</td>
    </tr>
    <tr class="active">
      <td>Holiday.png</td>
      <td>23 June 2017, 6:50 pm</td>
      <td>2 GB</td>
      <td>PNG Image</td>
    </tr>
    <tr>
      <td>user.rb</td>
      <td>Today 1:44 pm</td>
      <td>5.1 MB</td>
      <td>Ruby Source</td>
    </tr>
  </table>

  <div class="path">
    <span class="item laptop">Macintosh HD</span>
    <span class="item folder">Users</span>
    <span class="item home">Luka</span>
    <span class="item documents">Documents</span>
  </div>

</body>
</html>

More Repositories

1

Pine

A modern, native macOS markdown editor
Swift
3,309
star
2

NSWindowStyles

A showcase of the many different styles of windows possible with NSWindow on macOS
Swift
1,114
star
3

OpenQuickly

A custom 'open quickly' window that imitates macOS' Spotlight
Swift
122
star
4

hackd

A modern Hacker News iOS application, built with React Native
JavaScript
97
star
5

markr

Minimalistic markdown editor for MacOS with live preview
Swift
87
star
6

plyr

A hyperminimal, lightweight macOS desktop music application
Swift
50
star
7

dotfiles

MacOS dotfiles with an easy installation script
Emacs Lisp
20
star
8

mdtg

Quickly generate markdown tables in your terminal using a simplistic specification
Rust
16
star
9

BitStream

A rudimentary Electron application that utilises WebTorrent to stream and download a torrent simultaneously
JavaScript
15
star
10

hkn

A go module for interacting with Hacker News
Go
13
star
11

crypticker

A simple command line program to get current cryptocurrency data
Go
11
star
12

neon

Neon is a simple code editor for MacOS, that runs from the menubar.
JavaScript
10
star
13

Swift-NSUserNotificationPrivate

MacOS NSUserNotification Private API in Swift 4. Simple demonstration of undocumented notification features.
Objective-C
9
star
14

pickur-swift

Pickur is a simple colour converter written in swift. It converts HEX/RGB colours to NS/UI/HEX/RGB colours.
Swift
7
star
15

TikZi

A simple TikZ editor, viewer and exporter
Swift
6
star
16

rails-ecommerce

An ecommerce site built using rails. Includes: users, products, carts, orders, categories, multiple images, custom pages, image banners and more
Ruby
5
star
17

itunes-artworker

Python script to download iTunes album art
Python
5
star
18

lukakerr.github.io

Github pages site, built with jekyll
HTML
4
star
19

lightweight-slider

A very lightweight (~2.5kb), minimal, easy to use image slider/carousel. No jQuery, no dependencies
JavaScript
4
star
20

Sea

A simple lexer, parser and evaluator for a C like language
Haskell
3
star
21

latex-templates

LaTeX templates I've created that have been useful when writing math/computing/engineering assignments at uni
TeX
3
star
22

sublime-autotheme

A small script to change your sublime text theme for day and night. Made for MacOS.
Shell
3
star
23

homebrew-things

A repository containing casks and formula for my applications/scripts
Ruby
2
star
24

two-tone

Minimalistic CSS framework with light or dark options, completely responsive. Currently a work in progress
CSS
1
star