0.7.4-beta • Published 3 years ago

@nextcss/core v0.7.4-beta

Weekly downloads
432
License
MIT
Repository
github
Last release
3 years ago

Next.css Core Module

Core Module is part of Next.css framework. This module contains original Material Color Palette CSS styles for your Next.css project. You can use in all modern websites with module bundlers, like webpack, rollup, parcel.

Next.css on GitHub

How to Install

You can install with npm or yarn package managers.

npm i @nextcss/core @nextcss/reset @nextcss/material-colors
yarn add @nextcss/core @nextcss/reset @nextcss/material-colors

Simple import to your project, and add class rules to you HTML tags. Check available selector rules below.

import '@nextcss/reset';
import '@nextcss/core';
import '@nextcss/material-colors';

How to use

Example feature list block. Watch the resolution here Learn more about available CSS selectors below.

<section class="fs-16 lh-1.6 bg-grey-50 fg-grey-700 py-50">
  <!-- Container -->
  <div class="container-lg">
    <!-- Intro -->
    <div class="container-md text-center mb-20">
      <h1 class="fs-24 md:fs-30 fw-500 fg-grey-900 mb-10">Why Next.css</h1>
      <p>The world’s developers thinking in pixels, we also thinking in pixels.</p>
    </div>
    <!-- Feature list -->
    <div class="flex flex-wrap">
      <!-- Feature box -->
      <a href="#" class="md:w-12/6 lg:w-12/4 p-15">
        <div class="bg-white p-25 radius-3 shadow-1">
          <h2 class="fs-20 fw-500 fg-grey-900 mb-8">Shooting Stars</h2>
          <p class="leading-relaxed text-base mb-4">
            Fingerstache flexitarian street art 8-bit waistcoat. ..
          </p>
          <span class="fg-pink-500 inline-flex align-center">Learn More →</span>
        </div>
      </a>
      <!-- Repeated block here -->
      ..
    </div>
  </div>
</section>

Selectors

Responsive prefixes

Most classes you will encounter can be used with responsive prefixes. This gives you the option to use classes according to the screen size.

Example

<p class="fs-12 sm:fs-13 md:fs-14 lg:fs-16 xl:fs-18">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</p>

References

PrefixScreen sizeBreakpoint
Defaultnone
sm:Small390px
md:Medium768px
lg:Large1024px
xl:Extra large1400px

Containers

Containers are used to limit the width of content, preventing content from overflowing beyond the specified size.

Example

<div class="container-xl">content</div>

References

ClassnameMax. widthClassnameMax. width
container-xs480pxcontainer-xs/2240px
container-sm640pxcontainer-sm/2320px
container-md768pxcontainer-md/2384px
container-lg1024pxcontainer-lg/2512px
container-xl1280pxcontainer-xl/2640px

Padding and Margins

Padding is used to create space around an element's content, inside of any defined borders.

Example

<div class="px-5 py-10 mx-5 my-10">content</div>

References

These classes can be combined with Responsive prefixes.

ClassnameClassnameSideValues (1px step)Values (5px step)
p-{value}m-{value}around0..1015..500
px-{value}mx-{value}horizontal0..1015..500
py-{value}my-{value}vertical0..1015..500
pt-{value}mt-{value}top0..1015..500
pb-{value}mb-{value}bottom0..1015..500
pl-{value}ml-{value}left0..1015..500
pr-{value}ml-{value}right0..1015..500

Borders

Borders allow you to specify the style, width, and color of an element's border.

Example

<div class="b-2 b-dashed radius-5">content</div>

Border with

ClassnameSideValues (1px step)Values (5px step)
b-{value}around0..1015..100
bx-{value}horizontal0..1015..100
by-{value}vertical0..1015..100
bt-{value}top0..1015..100
bb-{value}bottom0..1015..100
bl-{value}left0..1015..100
br-{value}right0..1015..100

Border style

ClassnameUsageStyles
b-{style}commonnone|solid|dashed|dotted|double|groove|inset|outset|ridge
b-{style}tablescollapse|separate

Border radius

These classes can be combined with Responsive prefixes.

ClassnameValues (1px step)Values (5px step)Specific values
r-{value}0..1015..1001000|10000

Font size

Example

<p class="fs-12 sm:fs-13 md:fs-14 lg:fs-15 xl:fs-16">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</p>

References

These classes can be combined with Responsive prefixes.

ClassnameValues (1px step)Values (2px step)Values (5px step)
fs-{value}10..2022..4045..150

Font weight

Example

<p class="fw-900 sm:fw-800 md:fw-700 lg:fw-600 xl:fw-500">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</p>

References

These classes can be combined with Responsive prefixes.

ClassnameValues (100px step)
fw-{value}100..900

Line height

Example

<p class="lh-1.6">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>

References

ClassnameValues (0.1 step)
lh-{value}0..6

Text manipulation

Example

<p class="uppercase underline text-center">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</p>

References

ClassnameRelsult
uppercaretext-transform: uppercase
lowercasetext-transform: lowercase
capitalizetext-transform: capitalize
underlinetext-decoration: underline
line-throughtext-decoration: line-through
no-transformtext-transform: none
no-decorationtext-decoration: none

These classes can be combined with Responsive prefixes.

ClassnameRelsult
text-lefttext-align: left
text-centertext-align: center
text-righttext-align: right
text-justifytext-align: justify
text-trimtext-overflow: ellipsis

Display

Example

<div class="block md:flex">content</div>

References

These classes can be combined with Responsive prefixes.

ClassnameResult
inlinedisplay: inline
blockdisplay: block
inline-blockdisplay: inline-block
flexdisplay: flex
inline-flexdisplay: inline-flex

Order

Example

<ul class="flex">
  <li class="order-2">Item 2</li>
  <li class="order-1">Item 1</li>
</ul>

References

These classes can be combined with Responsive prefixes.

ClassnameValues (1 step)Specific values
order-{value}0...12first|last

Overflow

Example

<div class="md:h-300 md:overflow-y-overlay">
  <div class="flex overflow-hidden">content</div>
</div>

References

These classes can be combined with Responsive prefixes.

ClassnameDirectionSpecific values
of-{value}Bothauto|hidden|visible|scroll|overlay
of-x-{value}Horizontalauto|hidden|visible|scroll|overlay
of-y-{value}Verticalauto|hidden|visible|scroll|overlay

Overscroll

Example

<div class="h-300 overscroll-contain">content</div>

References

These classes can be combined with Responsive prefixes.

ClassnameDirectionSpecific values
os-{value}Bothauto|contain|none
os-x-{value}Horizontalauto|contain|none
os-y-{value}Verticalauto|contain|none

Object fit and position

Example

<div class="w-200 h-200">
  <img src="" alt="" class="fit-cover" />
</div>

References

These classes can be combined with Responsive prefixes.

ClassnameSpecific values
fit-{value}contain|cover|fill
object-{value}center|top|right|bottom|left

Floating and Box sizing

Example

<div class="float-none md:float-left">content</div>
<div class="clear-both">content</div>
<div class="box-content">content</div>

References

These classes can be combined with Responsive prefixes.

ClassnameSpecific values
float-{value}left|right|none
clear-{value}left|right|both|none
box-{value}border|content

Production build

We strongly recommend to use postcss with autoprefixer and postcss-purgecss. This stack will extend the CSS rules with browser specific prefixes, like -webkit and will remove unused styles in production build.

npm i -D postcss autoprefixer @fullhuman/postcss-purgecss

Our postcss.config.js config. You need to configure the content parameter for your project.

module.exports = {
  plugins:
    process.env.NODE_ENV === 'production'
      ? [
          'autoprefixer',
          [
            '@fullhuman/postcss-purgecss',
            {
              content: ['./{pages,components}/**/*.{js,jsx}'],
              safelist: ['html', 'body'],
              defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
            },
          ],
        ]
      : ['autoprefixer'],
};

License

MIT License. Copyright (c) 2021 Zsolt Tovis

0.7.1-beta

3 years ago

0.7.3-beta

3 years ago

0.7.4-beta

3 years ago

0.7.2-beta

3 years ago

0.6.1-beta

3 years ago

0.7.0-beta

3 years ago

0.5.8-beta

3 years ago

0.6.0-beta

3 years ago

0.5.9-beta

3 years ago

0.5.5-beta

3 years ago

0.5.6-beta

3 years ago

0.5.7-beta

3 years ago

0.5.1-beta

4 years ago

0.5.2-beta

4 years ago

0.5.0-beta

4 years ago

0.4.7-beta

4 years ago

0.4.6-beta

4 years ago

0.4.5-beta

4 years ago

0.4.4-beta

4 years ago

0.4.3-beta

4 years ago

0.4.2-beta

4 years ago

0.4.1-beta

4 years ago

0.4.0-beta

4 years ago

0.3.1-beta

4 years ago

0.3.0-beta

4 years ago

0.2.7-beta

4 years ago

0.2.6-beta

4 years ago

0.2.5-beta

4 years ago

0.2.4-beta

4 years ago

0.2.3-beta

4 years ago

0.2.2-beta

4 years ago

0.2.1-beta

4 years ago

0.2.0-beta

4 years ago

0.0.1-beta

4 years ago