Coder Social home page Coder Social logo

fountainpen / okcss Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andrewh0/okcss

0.0 0.0 0.0 214 KB

๐Ÿ†— Sensible styling defaults for your web page

Home Page: https://okcss.netlify.app

License: MIT License

JavaScript 1.17% CSS 46.89% HTML 51.94%

okcss's Introduction

๐Ÿ†— OK.css

Sensible styling defaults for your web page

Project page ยท Demo


OK.css is a classless CSS framework. Dropping it into your HTML will make your page look decent โ€” no need to reference documentation, think about responsiveness, or account for browser differences as long as your markup is semantically-correct.

To use it, you can download the CSS file directly or add the following line to your HTML <head>:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/andrewh0/okcss@1/dist/ok.min.css" />

Note that normalize.css is included in OK.css.

OK.css is somewhere between a CSS normalizer and a full-fledged framework like Bootstrap or Tailwind. It's great for blogs or small single-page applications, but might not be so great for large, interactive apps that require JavaScript or custom elements.

Development

Install dependencies with yarn install.

You can start a local server with yarn start. By default, the page will be available at http://localhost:5000.

Make updates to the CSS file in ./src/ok.css and yarn build to create a minified version available in ./dist/ok.min.css.

This repo is set up with Netlify's continuous deployment. yarn deploy copies files into a .gitignored directory called _site and _site is hosted on Netlify.

Releasing

Confirm changes with:

yarn release:dry

Release with:

yarn release

Contributing

Pull requests are welcome! If you find a bug or have a feature request, please submit a GitHub issue.

Alternative features

Not all UI features can be implemented with classless CSS while remaining accessible and supported cross-browser. For more complex features, you may need to supplement this framework with additional HTML, CSS, or JavaScript.

Here are some suggestions for altering the behavior of certain elements.

Feature

Make tables scroll horizontally when they are wider than the main content width.

Desired behavior:

HTML table with horizontal scroll

Note: In OK.css, tables are set to display: table for accessibility reasons.

Implementation

Wrap the table in a <div> with overflow-x: scroll;:

<div style="overflow-x: scroll">
  <table>
  ...
  </table>
</div>

One caveat is that this can prevent the table heading from sticking when scrolling vertically.

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.