https://github.com/emareg/classlesscss
CSS with few but great styles for basic HTML5 tags
https://github.com/emareg/classlesscss
css3 html5-tags responsive-design
Last synced: 10 months ago
JSON representation
CSS with few but great styles for basic HTML5 tags
- Host: GitHub
- URL: https://github.com/emareg/classlesscss
- Owner: emareg
- License: mit
- Created: 2019-05-16T12:19:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-08T19:50:35.000Z (over 1 year ago)
- Last Synced: 2024-09-09T20:49:09.829Z (over 1 year ago)
- Topics: css3, html5-tags, responsive-design
- Homepage: http://classless.de
- Size: 930 KB
- Stars: 215
- Watchers: 10
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README

# Classless.css
Classless.css is one small CSS file, which defines few but great styles for basic HTML5 tags plus a few classes for grid and spacing. Nothing more. Nothing less.
**Demo:** at [classless.de](http://classless.de)
## Features
* **Small.** Only 400 lines of pure CSS3 for tooltips, grid, navigation bar, cards and more.
* **Single File.** Everything in one file, no dependencies, no JavaScript.
* **Modular.** Don't need all features? The CSS file is structured into feature groups, simply delete what you don't need¹.
* **Responsive.** We use media queries, em/rem units, and smart overflows for tables and code.
* **Bootstrap Compatible.** Special features that require classes use the same names as Bootstrap.
¹: we also offer a pre-made tiny version (80 lines) with only the base styles.
## Getting Started
For testing, you can simply insert the following line into your HTML file. For production, please host the classless.css file yourself.
```html
```
### Embedding Font 'Open Sans'
Classless looks best with the font 'Open Sans'. Earlier versions of Classless directly imported the font from [Google Fonts](https://fonts.google.com/specimen/Open+Sans). However, this leaks the visitor's IP to Google servers which is [not compliant](https://www.theregister.com/2022/01/31/website_fine_google_fonts_gdpr/) with EU's GDPR. We therefore leave it to the user to choose how to import the font. Click on one of the following three methods
1. Import from Google Font Anyway.
Add the following line to Classless.css:
```css
@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400');
```
In order to be compliant with GDPR, you need to ask for the visitor's consent.
2. Use a GDPR compliant CDN.
Instead of using Google, you could import the font from a CDN that is GDPR compliant. Candidates (no guarantee) are
#### CDN Fonts
Offers the fonts but no idea where this service is hosted or how it processes IP addresses.
```css
@import url('http://fonts.cdnfonts.com/css/open-sans');
```
#### Unpkg
[Unpkg](https://unpkg.com/) hosts files of NPM packages, including `fontsource`.
They also have an [open issue](https://github.com/mjackson/unpkg/issues/294) regarding GDPR compliance, but as of 2022 there is no statement. Since the CSS files are written for local access (relative paths), you need to add the following font definitions.
```css
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-display: swap;
font-weight: 400;
src: url('https://unpkg.com/@fontsource/open-sans@4.5.8/files/open-sans-all-400-normal.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-display: swap;
font-weight: 700;
src: url('https://unpkg.com/@fontsource/open-sans@4.5.8/files/open-sans-all-400-normal.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-display: swap;
font-weight: 400;
src: url('https://unpkg.com/@fontsource/open-sans@4.5.8/files/open-sans-all-400-italic.woff') format('woff');
}
```
3. Host Fonts Yourself.
#### Add Manually
The following project offers a step-by-step explanation for hosting Google fonts on your own server:
https://gwfh.mranftl.com/fonts/open-sans?subsets=latin
#### Using NPM
Install fontsource and add `@import '@fontsource/open-sans';` to classless.css
```bash
npm install @fontsource/open-sans
echo -e "\n@import '@fontsource/open-sans';\n" >> classless.css
```
Besides that, Classless looks nice with many fonts and you can choose any other font you like.
## Comparison of Minimal Frameworks
Classless
Skeleton
Milligram
Sakura
Features
responsive, grid,
themes, navbar,
cards, utilities
responsive,
grid
responsive,
grid, utilities
responsive
Size
11.2 kB
400 LOC
11.2 kB
400 LOC
10.3 kB
600 LOC
3.3 kB
165 LOC
Reset
tiny reset
normalize
normalize
normalize
Browsers
Chrome, FF,
Edge
Chrome, FF
Chrome, FF, Opera
Edge, Safari
Chrome, FF
License
MIT
MIT
MIT
MIT
## Classeless Support
| Browser Support | v0.94 | v0.95 | v1.0 | v1.1 |
|-------------------------------|------------|------------|------------|--------------|
| FireFox 122.0 on Ubuntu 22.04 | -- | -- | perfect | perfect |
| Chrome 128.0 on Windows 10 | -- | -- | perfect | perfect |
| Edge 128.0 on Windows 10 | -- | -- | perfect | perfect |
| Firefox 103.0 on Android 14 | -- | -- | perfect | perfect |
| Brave 1.69 on Android 14 | -- | -- | perfect | perfect |
| Chromium 96.0 on Ubuntu 20.04 | -- | perfect | perfect | -- |
| FireFox 97.0 on Ubuntu 20.04 | -- | perfect | perfect | -- |
| FireFox 84.0 on Windows 10 | perfect | perfect | perfect | -- |
| Edge 88.0 on Windows 10 | perfect | perfect | perfect | -- |
| IE 11 on Windows 10 | poor/good¹ | poor/good¹ | poor/good¹ | -- |
| FireFox 85.1 on Android 10 | perfect | perfect | perfect | -- |
| Samsung Browser on Android 10 | perfect | perfect | perfect | -- |
| Safari on iPhone 10 | perfect | -- | good² | -- |
¹: Classless-full: body full width, table and code styles ignored, cite elements overlap text. However, classless-tiny without variables looks good.
²: card borders not rounded