Coder Social home page Coder Social logo

ipfs-shipyard / ipfs-css Goto Github PK

View Code? Open in Web Editor NEW
24.0 12.0 19.0 92.34 MB

The single-purpose css class names and font-face config to IPFS up your UI.

License: MIT License

JavaScript 7.74% CSS 9.00% Makefile 0.78% HTML 56.84% Shell 1.72% Python 14.81% C 8.18% Dockerfile 0.04% Objective-C++ 0.41% SCSS 0.48%
css ipfs theme scss dweb ipfs-gui

ipfs-css's Introduction

ipfs-css

The single-purpose CSS class names and @font-face config to IPFS up your UI.

/* ---- font ----- */
.sans-serif { font-family: 'Inter', system-ui, sans-serif; }
.montserrat { font-family: 'Montserrat', 'Verdana', system-ui, sans-serif; }
.monospace { font-family: Consolas, monaco, monospace; }

/* ---- color ----- */
.navy { color: #0b3a53; }
.navy-muted { color: #244e66; }
.aqua { color: #69c4cd; }
.aqua-muted { color: #9ad4db; }

/* ...and (just a little) more! */

Pairs well with tachyons.

Install

Add ipfs-css to your project via npm:

npm install ipfs-css

Usage

Once you've installed ipfs-css from npm, the CSS and SCSS files and the web-fonts are available from your node_modules/ipfs-css directory.

If you are set up with a build process that lets you import css files directly from node_modules, then you can just add the following to your CSS file.

@import 'tachyons'; /* Optional, jolly good tho */
@import 'ipfs-css';

The file includes font-face definitions and single purpose CSS class names that you can compose freely, to create your lovely UI.

<header class='pa2 bg-navy'>
  <h2 class='ma0 montserrat aqua'>
    OH HAI! It's so nice to see you again.
  </h2>
</header>

CSS in JS

You can import the theme.json file which can be used with a ThemeProvider component.

All the CSS atoms are generated from that, so you can be sure you're using the same values.

Less

ipfs.css is a regular CSS file, so you can import it normally. Each declaration has a single purpose, so if you prefer to compose your rules outside the DOM, you can safely use them as mixins:

.my-lovely-widget {
  .aqua;
  .bg-navy;
  .montserrat;
}

SCSS

While ipfs.css contains everything you need, if you prefer variables for fonts, colors and gradients, these are there for you in theme.scss.

Icons

See: https://dweb.link/ipfs/bafybeiebays3i7aem7tptga3kilzux7f5gz6czl4dietazgutcjhozjviu

Colors

Releasing

First, clean and build the CSS and the docs.

# Clean then build your local workspace
$ npm run clean
$ npm run build

Next, with IPFS running locally, add the docs to IPFS, to get the new CID.

# Add the docs to IPFS to get the CID
$ npm run -s deploy:docs
QmQYzfzGKAeBWgarrmTSsG2PJ8AFfFEBprhVBFaudcFTof

Pin the CID to ipfs-cluster (via #pinbot on IRC or your preferred method). Update the README.md with the new docs link.

Then bump the version, push to GitHub and publish to npm. If you are adding an icon, that's a minor release. Fixing an issue with an existing icon would be a patch. Changing any of the color values would be at least a minor. Changing the naming scheme for the CSS classes would be a major release.

# use npm to bump the version and tag
$ npm version minor

# Push the changes back to the repo
$ git push origin master
$ git push --tags

# PUBLISH!
$ npm publish

Contribute

Contributions are more than welcome! Check out the currently open issues and start hacking on anything that sounds interesting. Issues are labeled with a variety of tags to help you find a good fit — you may wish to start with the help-wanted tag.

To contribute to IPFS in general, check out the wide variety of opportunities here.

The IPFS community believes that our mission is best served in an environment that is friendly, safe, and accepting, and free from intimidation or harassment. To that end, we ask that everyone involved in IPFS read and respect our code of conduct.

License

The Monserrat font family © The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat) is used under the SIL Open Font License, Version 1.1.

The Inter font family © The Inter Project Authors ([email protected]) is used under the SIL Open Font License, Version 1.1.

The home icon © Icons8 is under their Free License

All other documents and icons are CC-BY-SA 3.0 license © 2018 Protocol Labs Inc.

Code is under the MIT © 2018 Protocol Labs Inc.

ipfs-css's People

Contributors

alanshaw avatar andrew avatar bluelovers avatar dependabot[bot] avatar hacdias avatar jessicaschilling avatar juliaxbow avatar lidel avatar nothingismagick avatar olizilla avatar sgtpooki avatar

Stargazers

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

Watchers

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

ipfs-css's Issues

Move to @ipfs

@lidel I think we should consider moving this repository to @ipfs org as projects in @ipfs, such as Web UI, depend on it. What do you think?

Fonts: Il| O0

Just to throw some oil on the smoking embers of the typography battlefield, it should be clear that many sans-serif fonts do not make an OBVIOUS differentiation between the I, the l and the |. In normal usage, native speakers shouldn't have a problem understanding that Illustration is the capitalised letter after "H" and before "J" and it is followed by the lower-case letter "L" twice.

I took a look at the IPFS_brandbook.pdf - and it suggested using Monserrat with Verdana as a fallback. Here in this repo, there is the introduction of Inter-UI. Of those three fonts, only Verdana distinguishes perfectly between I, the l and the |. Inter-UI is a total fail, because the I and the l are absolutely entirely indistinguishable.

This is moot for normal hashes, because adopting base58 encoding solves the visual problem. Nevertheless, I bring this up as a font-fetishist because the reason we have different letters is, as with words, they help us build meaning. I would love to have a discussion here and think about ways forward. I see three:

  1. Stick with the choices made. (status-quo)
  2. Find better solutions. (discussion)
  3. Modify an existing font. (hard work)

Scope and name of this artifact

(we had some casual discussions, but I feel we should make a final decision on this)

Are we going to continue shipping fonts and icons together with css?
Will UI Kit be a single npm package?

  • If we want to keep everything under ipfs-css name perhaps it time to change its name to something less CSS centric (ipfs-ui-kit)?
  • Or does it make sense to ship UI Kit as multiple packages?
    (ipfs-ui-kit-icons+ipfs-ui-kit-css+ipfs-ui-kit-fonts)

Redefining `.link` changes the specificity and causes suprises

Colours of things in ipld explorer have been overriden where ever they are also a .link. It's an unfortunate inclusion in tachyons, but we've used it to strip underlines off things in a few places. When it got overridden in ipfs-css it's specificity got a boost and it now overrides colours in a few places

ipld explorer cid info panel... the 12 in the legend should be orange to match the 12 in the multihash
Screenshot 2021-04-23 at 14 42 59

ipld explorer graph crumb... the text colour should match the underline colour
Screenshot 2021-04-23 at 15 12 26

I suggest we remove .link from ipfs-css

LICENSE

As far as I am aware, it is not possible for a non-entity "ipfs-shipyard" to hold a copyright. To be legally binding, the LICENSE should be attributed to "Protocol Labs and Associated Developers".

Convert to SCSS

It would be nice to have the colours available as scss variables. Scss also compiles to css, so the resulting package would give better support for everyone.

Include icon names on icon page

Currently, the list of icons requires you to right click, view image and then take the name from the filename.

Would be nicer to have the icon name right next to the icon instead.

Fonts: Package the SIL licenses

Both Inter-UI and Montserrat use the SIL license, and Inter-UI has an additional personal copyright notice. These must be delivered with the fonts and made available to the consumer of the product.

https://github.com/rsms/inter/
https://fonts.google.com/specimen/Montserrat

  1. Original or Modified Versions of the Font Software may be bundled,
    redistributed and/or sold with any software, provided that each copy
    contains the above copyright notice and this license. These can be
    included either as stand-alone text files, human-readable headers or
    in the appropriate machine-readable metadata fields within text or
    binary files as long as those fields can be easily viewed by the user.

It may be wise to make a notice of this in
https://github.com/ipfs-shipyard/ipfs-css/blob/master/LICENSE

CSS Scrollbars

I wonder if we should add some classes that unify scrollbars across all platforms (for use in overflow situations).

Support for W3C Spec draft landed in Firefox 64:

CSS Scrollbars: The CSS Scrollbars Level 1 spec standardizes features for setting scrollbar width and color, which were originally only available in Internet Explorer. See CSS Scrollbars on MDN Web Docs and Scrollbars on CSS Tricks for more information.
https://hacks.mozilla.org/2018/12/firefox-64-released/

I imagine Chrome will follow eventually, but for now we could support it via Old WebKit Spec linked in Refs below (::-webkit-scrollbar*)

Refs.

Add multiple font types

A solid font-pack would have a whole set of font-types:

  • .eot
  • .svg
  • .ttf
  • .woff
  • .otf
  • .woff2

Woff2 is not enough, for reasons of compatibility.

screen shot 2018-03-31 at 01 53 11

screen shot 2018-03-31 at 02 05 42

Automated Release and Pinning

Right now, the release process is quite manual and, even though we don't have frequent updates on this repository, I would be useful to have automated releases performing the build and pinning. Additionally, we could also remove the directory docs from the control versioning since that's the result of the build process.

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.