🎍 Ukrop.css is an instant solution to styling web pages. It does not aim to be the most slim solution, but to be a complete one, which you can reliably use for any project. It is also an attempt to show that using css classes everywhere is a signal of bad atomic design in layouts — meaning that you don't need to use css classes for most of the content.
- No classes required, just your semantic HTML code;
- Responsive and
em
/rem
-driven; - Predictable layout thanks to consistent use of
padding
andmargin-bottom
; - Looks cool with 0 effort;
- Has callouts for your quotes, links and forms;
- Custom radio and checkbox elements with 0 extra elements;
- Configurable via Stylus and CSS variables. See _vars.styl!
- Easy to build upon due to its modularity and exposed color variables;
- Automagically turns to black if a user has a dark UI theme (and if a browser supports it).
Install
Ukrop can be used as a plain css file or as a collection of stylus files.
Plain CSS
Download the minified CSS file and put it to your site's /css
folder. Then, add this tag to your html's head
section:
<link rel="stylesheet" href="/css/ukrop.min.css"></link>
Stylus
Download the repo's folder or install it to your project as a git submodule (assuming you have a stylus
folder):
git submodule add https://github.com/CosmoMyzrailGorynych/ukrop.git ./stylus/ukrop
Then, e.g. in your ./styl/index.styl
, add this line:
@require './ukrop/index.styl'
Or use individual files:
@require './ukrop/lib/forms.styl'
Theming
Ukrop.css uses a number of variables that define its look and feel:
--accent
--accent12
--accent25
--contrast
--error-color
--text-color-light
--text-color-dark
--bg-light
--bg-dark
--border-radius
--border-width
Example: Generic blog post
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Pellentesque habitant morbi tristique senectus et netus et malesuada. Quam viverra orci sagittis eu volutpat odio.
Sed cras ornare arcu dui vivamus arcu felis bibendum. Amet consectetur adipiscing elit ut aliquam purus
sit.
Interdum posuere lorem
Interdum posuere lorem ipsum dolor sit amet consectetur adipiscing. At varius vel pharetra vel turpis nunc eget lorem dolor.
Pretium quam vulputate dignissim suspendisse in est ante in nibh. Pharetra vel turpis nunc eget lorem dolor sed viverra ipsum.
Faucibus vitae aliquet nec ullamcorper sit amet risus. Habitasse platea dictumst quisque sagittis. Pellentesque id nibh tortor
id aliquet lectus proin nibh nisl. Convallis convallis
tellus id interdum velit laoreet id donec.
Morbi blandit cursus risus at. Amet aliquam id diam maecenas ultricies mi. Faucibus vitae aliquet nec ullamcorper sit amet risus.
Julius Caesar
Turpis egestas sed tempus urna et pharetra pharetra massa massa.
/* If it fits, it sits. If it sits, it fits. If it fits, it sits. If it sits, it fits.*/
h1, h2, h3, h4, h5, h6
margin $outerSpacing 0 $innerSpacing
&:first-child, aside:first-child + &
margin-top 0
Sollicitudin tempor id eu nisl. Leo urna molestie at elementum eu facilisis sed. Consequat id porta nibh venenatis cras. Elementum sagittis vitae et leo duis ut. Felis bibendum ut tristique et.
Nisi scelerisque eu
Nisi scelerisque eu ultrices vitae auctor eu augue ut. At quis risus sed vulputate.
Blandit cursus risus at ultrices. Aliquam nulla facilisi cras fermentum odio eu feugiat pretium nibh. Nisl tincidunt eget nullam non nisi. Arcu cursus vitae congue mauris rhoncus aenean vel. Malesuada fames ac turpis egestas integer. Arcu non odio euismod lacinia at quis risus sed vulputate.
Faucibus vitae aliquet nec ullamcorper sit amet risus. Habitasse platea dictumst quisque sagittis. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Example: Form elements
Example: Table
IP | Status | Notes |
---|---|---|
10.10.10.1 | Active | Lorem ipsum dolor dolor dolor |
10.10.10.2 | Active | Lorem ipsum dolor |
10.10.10.3 | Disabled | Lorem ipsum dolor dolor dolor |
10.10.10.4 | Active | Lorem ipsum |
10.10.10.5 | Active | Lorem ipsum dolor dolor dolor dolor |
10.10.10.6 | Active | Lorem ipsum dolor dolor dolor dolor |
10.10.10.7 | Active | Lorem ipsum |
10.10.10.8 | Disabled | Lorem ipsum dolor |
10.10.10.9 | Active | Lorem ipsum |
10.10.10.10 | Active | Lorem ipsum dolor dolor dolor dolor |
A little label at the top of the table is made by the caption
tag.
Example: A very long table + section
Tables are not that easy to wrap or to constrain to specific size without an additional markup.
If you are using semantic html only, the best way is putting it to a separate section
.
Still quite semant-y, and section
s will show a scrolllbar underneath tables.
accusamus | natus | corrupti | assumenda | quae | quae | accusamus | assumenda | perspiciatis | nulla | voluptatibus | consectetur | assumenda | nobis | ipsum |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
modi | quae | elit | odio | necessitatibus | corrupti | necessitatibus | doloribus | aperiam | natus | corrupti | perspiciatis | quae | corporis | dolor |
doloribus | natus | modi | aperiam | ipsum | aperiam | consectetur | accusamus | consectetur | adipisicing | corporis | nesciunt | quae | modi | consectetur |
sit | nulla | nulla | corrupti | odio | lorem | consectetur | corrupti | consectetur | perspiciatis | assumenda | doloribus | odio | assumenda | nobis |
nulla | modi | adipisicing | perspiciatis | corrupti | amet | aperiam | odio | voluptatibus | ipsum | nobis | alias | necessitatibus | natus | voluptatibus |
accusamus | quae | perspiciatis | corrupti | accusamus | corrupti | assumenda | enim | corporis | amet | consectetur | quisquam | nulla | corporis | doloribus |
nobis | enim | amet | accusamus | perspiciatis | aperiam | suscipit | consectetur | suscipit | nobis | nulla | lorem | odio | corporis | suscipit |
nobis | quisquam | dolor | lorem | odio | dolor | alias | consectetur | amet | perspiciatis | nobis | doloribus | sit | amet | ipsum |
doloribus | lorem | corrupti | lorem | accusamus | aperiam | enim | quisquam | nobis | nulla | elit | corporis | enim | nobis | assumenda |
natus | nesciunt | perspiciatis | corporis | corrupti | corporis | nesciunt | corrupti | nesciunt | corporis | voluptatibus | ipsum | lorem | nobis | ipsum |
necessitatibus | quisquam | consectetur | assumenda | accusamus | amet | quisquam | corrupti | sit | perspiciatis | corrupti | modi | suscipit | elit | amet |
Example: A very long table + breaking rules
With a little aid of CSS + one div
, you can make a table scrollable. This is not the semantic way™, but whatever:
<div style="overflow-x: auto;">
<table>
…
</table>
</div>
Result:
sit | ipsum | natus | nobis | sit | sit | consectetur | nulla | corrupti | perspiciatis | natus | dolor | quae | nesciunt | voluptatibus |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
assumenda | alias | aperiam | quisquam | amet | enim | nulla | quae | corrupti | quae | alias | sit | accusamus | aperiam | sit |
assumenda | aperiam | nulla | elit | doloribus | odio | quisquam | sit | consectetur | quisquam | accusamus | corporis | adipisicing | elit | quae |
suscipit | nesciunt | quae | consectetur | corrupti | nulla | elit | dolor | voluptatibus | aperiam | amet | assumenda | odio | adipisicing | enim |
aperiam | doloribus | dolor | perspiciatis | aperiam | adipisicing | nulla | assumenda | alias | dolor | quae | nulla | adipisicing | consectetur | alias |
assumenda | amet | doloribus | natus | voluptatibus | modi | consectetur | suscipit | nulla | quae | nobis | aperiam | odio | enim | corporis |
natus | amet | quisquam | perspiciatis | dolor | odio | voluptatibus | quae | elit | odio | ipsum | corporis | quae | odio | necessitatibus |
necessitatibus | amet | assumenda | lorem | nesciunt | sit | nulla | nulla | corporis | corporis | quisquam | dolor | aperiam | dolor | sit |
necessitatibus | ipsum | dolor | aperiam | necessitatibus | corrupti | accusamus | ipsum | alias | perspiciatis | alias | quae | odio | nulla | corrupti |
amet | accusamus | amet | sit | odio | accusamus | lorem | accusamus | suscipit | ipsum | alias | lorem | ipsum | assumenda | aperiam |
suscipit | nulla | modi | enim | sit | consectetur | assumenda | adipisicing | voluptatibus | natus | enim | doloribus | quisquam | necessitatibus | natus |