{"id":16540077,"url":"https://github.com/charliewilco/obsidian","last_synced_at":"2025-03-21T09:32:21.992Z","repository":{"id":35062359,"uuid":"39201128","full_name":"charliewilco/obsidian","owner":"charliewilco","description":"💎 A Modular CSS Library","archived":false,"fork":false,"pushed_at":"2023-01-07T04:08:46.000Z","size":2611,"stargazers_count":28,"open_issues_count":11,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T01:52:20.943Z","etag":null,"topics":["css","css-framework","itcss","postcss","postcss-plugin"],"latest_commit_sha":null,"homepage":"https://obsidian.charliewil.co","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charliewilco.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-16T14:20:34.000Z","updated_at":"2025-03-12T21:01:32.000Z","dependencies_parsed_at":"2023-01-15T13:15:29.168Z","dependency_job_id":null,"html_url":"https://github.com/charliewilco/obsidian","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charliewilco%2Fobsidian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charliewilco%2Fobsidian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charliewilco%2Fobsidian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charliewilco%2Fobsidian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charliewilco","download_url":"https://codeload.github.com/charliewilco/obsidian/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130270,"owners_count":20402753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","css-framework","itcss","postcss","postcss-plugin"],"created_at":"2024-10-11T18:51:30.538Z","updated_at":"2025-03-21T09:32:21.676Z","avatar_url":"https://github.com/charliewilco.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![Obsidian.css](http://cl.ly/2T0B352h1d1n/obsidian-header.png)\n\n[![npm version](https://badge.fury.io/js/obsidian.css.svg)](https://badge.fury.io/js/obsidian.css)\n[![Build Status](https://travis-ci.org/charliewilco/obsidian.svg?branch=master)](https://travis-ci.org/charliewilco/obsidian)\n\nObsidian.css is a modular CSS library that focuses on code common to most projects.\n\nThis project works under the belief that when abstracted most CSS is shockingly similar across projects. More than likely you'll need a type scale, a grid system, spacing utilities, media blocks, sensible default styling for elements (forms, tables, buttons). This project is a collection of the CSS patterns that have stuck with me over the last two years and grown with me.\n\nStyles are written in an adapted BEM naming convention and organized in an [ITCSS-like](/itcss) methodology. It uses PostCSS plugins to compile variables, color functions and add vendor prefixes.\n\n## Installation\n\n```\nyarn add obsidian.css --save\n```\n\nor link to the CDN\n\n```markup\n\u003clink rel=\"stylesheet\" href=\"https://unpkg.com/obsidian.css\" media=\"screen\" title=\"Obsidian.css\" charset=\"utf-8\"\u003e\n```\n\n### Using in Build\n\nRecommended you use [PostCSS](https://github.com/postcss/postcss) and [postcss-import](https://github.com/postcss/postcss-import).\n\nExample using Gulp.js:\n\n```js\nconst gulp = require('gulp');\nconst postcss = require('gulp-postcss');\nconst atImport = require('postcss-import');\nconst env = require('postcss-preset-env');\n\nconst processors = [atImport, env];\n\ngulp.task('styles', () =\u003e {\n  return (\n    gulp\n      .src('path/to/stylesheet')\n      .pipe(postcss(processors))\n      // Probably other tasks\n      .pipe(gulp.dest('path/to/destination'))\n  );\n});\n```\n\nthen import into your CSS and modify some variables:\n\n```css\n@import 'obsidian.css/lib/settings';\n@import 'obsidian.css/lib/generic';\n@import 'obsidian.css/lib/elements';\n\n@import 'obsidian.css/lib/objects/obsidian.grid';\n```\n\n```css\n@import 'obsidian.css';\n\n:root {\n  --headlines: 'Proxima Nova Condensed', Lucida Grande, sans-serif;\n  --body-text: 'Meta Serif Pro', Charter, serif;\n}\n```\n\nAnd things should compile the way you'd expect.\n\n## Methodology\n\n### ITCSS\n\n[ITCSS](https://www.youtube.com/watch?v=1OKZOV-iLj4) (Inverted Triangle CSS) from Harry Roberts, is a way of structuring CSS in such a way that the most general selectors to trickle down to the most specific selectors, as if they're moving from the top of an bottom of a triangle to the pinnacle of it.\n\nIn this implementation there are a few differences. Normally in ITCSS, you could have a tools like Sass functions, but most of the tools we'd need are coming in CSS and transpiled by [PostCSS plugins](https://postcss.org/).\n\nObjects have minimal visual styling in Obsidian. This is a set between the reset styling and the component level styling because it's beyond an element.\n\nSettings contain base styles but often module variables are only contained in that module; there are a few exceptions (like shadow values).\n\n### Naming Classes\n\nClasses in Obsidian are named with purpose.\n\n### Prefixes\n\nObjects, components, and utilities are all prefixed (`.o-`, `.c-`, `.u-`). This leads to clear class names, class names we can search for an `outline` for QA. It also puts a hard line between objects and components.\n\n#### Exceptions\n\nElements are not prefixed (ie. `.list`, `.table`) because they extend responsive ability or serve as a opt-in default for an element vs opinionated styling. Classes in `obsidian.forms-ui` add specific opinionated styling that's common to projects.\n\n#### Suffixes\n\nObsidian uses responsive suffixes `@sm`. Responsive targeting shouldn't be a modifier and falls in its own category. Obsidian defaults to a mobile first approach to CSS, meaning that classes without suffixes apply their styles to all screen sizes and ascend upward for styling per suffix.\n\n`@sm`, `@md`, `@lg` are the given suffixes in Obsidian.\n\n#### BEM\n\n[BEM](https://en.bem.info/) is a naming convention that gives class names informative and clear meaning.\n\n```\n.block__element--modifier {\n  /* Declarations */\n}\n```\n\n##### Block Names\n\nBlocks can be described as squares you can draw around a piece of UI or the root of a module (visual or conceptual). Most block names should be really simple, so avoid abbreviating or complicating. If two words are needed to describe a block separate them with a single hyphen `-`.\n\nBlocks are the basis of a name. They can have both a modifier and a element attached (`.block__element--modifier`) or have just have one (either a modifier `.block--modifier` or an element `.block__element`.\n\nUtilities in Obsidian get a specific block name that describes their function. For example `d` abbreviating `display` or `bkg` abbreviating `background`.\n\n##### Element Names\n\nElements are pieces of a block separated from a block by a double underscore `__`. `.c-modal__close` would refer to a close link for a modal component, `.o-intrinsic__item` would refer to the item in the intrinsic container.\n\n##### Modifier Names\n\nModifiers add to the block or element in some way, hence modifying it. `.o-icon--sm` would refer to a small icon object and `.o-grid__col--3/12` would refer to a grid column that's 3 parts of 12.\n\nUtility modifiers get a single hyphen `-`.\n\n#### Sources\n\n- [BEMIT](http://csswizardry.com/2015/08/bemit-taking-the-bem-naming-convention-a-step-further/)\n- [More Transparent UI Code with Namespaces](http://csswizardry.com/2015/03/more-transparent-ui-code-with-namespaces/)\n- [Dropbox CSS Styleguide](https://github.com/dropbox/css-style-guide)\n\n## Contributing\n\nFirst off, you're awesome for wanting to contribute. Second, please take a second to go over a few things to make this process simpler for everyone. Third, you're awesome.\n\n### Getting Started\n\nClone the repository and run the following in the root of the project:\n\n```sh\nyarn\n\nyarn workspace obsidian-documentation dev -p 5000 # open this in one tab\n\nyarn workspace obsidian.css dev # open this in another\n```\n\nThis project uses [yarn workspaces](https://yarnpkg.com/en/docs/workspaces).\n\nInside this project there are PostCSS plugins, the core library, and the dev documenation.\n\n### Issues\n\n**Reduced test cases are required**. All bug reports and problem issues require a reduced test case. See [CSS Tricks - Reduced Test Cases](http://css-tricks.com/reduced-test-cases/) on why they _\"are the absolute, ... number one way to troubleshoot bugs.\"_ Reduced test cases help you identify the issue at hand and understand your own code. On our side, they greatly reduce the amount of time spent resolving the issue.\n\n- A reduced test case is an isolated example that demonstrates the bug or issue.\n- It contains the bare minimum HTML, CSS, and JavaScript required to demonstrate the bug. No extra functionality or styling.\n- A link to your site is **not** a reduced test case.\n- A [JSBin](http://jsbin.com/) or [CodePen](http://codepen.io) is preferred so we can help you fix an error.\n\n### Pull Requests\n\n- [Fork](https://github.com/charlespeters/obsidian#fork-destination-box) this repo.\n- Push to your fork and submit a pull request.\n- Please provide a short explanation of why you made the changes you made.\n\n## License\n\nMIT\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharliewilco%2Fobsidian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharliewilco%2Fobsidian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharliewilco%2Fobsidian/lists"}