Skip to content
This repository was archived by the owner on Jul 25, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist/
lib/
sassdoc/
docs/
node_modules/
Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# dist/
# lib/
.vscode/
.circleci/
docs/
Expand Down
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
CHANGELOG.md
CHANGELOG.md
lib/index.css
lib/index.min.css
2 changes: 1 addition & 1 deletion .sassdocrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ herman:
displayColors:
- hex
- rgba
customCSS: './dist/index.min.css'
customCSS: './lib/index.min.css'
nunjucks:
templatePath: './templates'
trackingCode: '<style type="text/css">
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2020 xamu.com.co
Copyright 2020 @xamu-co

Permission 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:

Expand Down
37 changes: 18 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "@open-xamu-co/style-system",
"version": "1.0.0",
"description": "Style system for the xamu project",
"main": "dist/index.css",
"browser": "dist/index.min.css",
"main": "lib/index.css",
"browser": "lib/index.min.css",
"source": "src/index.scss",
"scripts": {
"i": "yarn --frozen-lockfile",
"format": "copy-files-from-to && prettier dist/*.formatted.css --no-config --write",
"sass": "sass src/index.scss dist/index.css",
"postcss": "postcss dist/index.css -o dist/index.min.css --no-map",
"format": "copy-files-from-to && prettier lib/*.formatted.css --no-config --write",
"sass": "sass src/index.scss lib/index.css",
"postcss": "postcss lib/index.css -o lib/index.min.css --no-map",
"css:compile": "yarn sass && yarn postcss --verbose && yarn format",
"build": "yarn css:compile && yarn docs:compile",
"watch": "yarn sass --watch",
Expand Down Expand Up @@ -51,26 +51,25 @@
"@commitlint/config-conventional": "^9.1.1",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"autoprefixer": "^9.8.6",
"copy-files-from-to": "^3.2.0",
"cssnano": "^4.1.10",
"cssnano-preset-advanced": "^4.0.7",
"cssnano": "^6.0.1",
"cssnano-preset-advanced": "^6.0.1",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"node-css-mqpacker": "^8.0.1",
"node-css-mqpacker": "^9.0.0",
"postcss": "^8.2.10",
"postcss-cli": "^8.3.1",
"postcss-custom-properties": "^9.1.1",
"postcss-merge-at-rules": "^1.0.1",
"postcss-merge-selectors": "vis97c/postcss-merge-selectors",
"postcss-precision": "vis97c/postcss-precision",
"postcss-sort-media-queries": "^3.8.9",
"postcss-preset-env": "^8.4.1",
"postcss-sort-media-queries": "^5.2.0",
"prettier": "^2.0.5",
"sass": "1.32.10",
"sass": "^1.60.0",
"semantic-release": "^17.1.1",
"sort-css-media-queries": "vis97c/sort-css-media-queries",
"stylelint": "^13.6.1",
"stylelint-config-prettier": "^8.0.2",
"stylelint-prettier": "^1.1.2"
"stylelint-config-prettier": "^9.0.5",
"stylelint-prettier": "^3.0.0"
},
"engines": {
"node": ">=16.19.0",
Expand Down Expand Up @@ -98,7 +97,7 @@
]
},
"prettier": {
"tabWidth": 4,
"tabWidth": 2,
"useTabs": true,
"endOfLine": "auto",
"requirePragma": false,
Expand All @@ -113,12 +112,12 @@
}
},
"browserslist": [
"last 2 versions, > 0.5%, ie >= 11"
"defaults"
],
"copyFiles": [
{
"from": "dist/index.min.css",
"to": "dist/index.formatted.css"
"from": "lib/index.min.css",
"to": "lib/index.formatted.css"
}
],
"copyFilesSettings": {
Expand Down
52 changes: 20 additions & 32 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
const nano = {
preset: [
"advanced",
{
discardComments: {
removeAll: true,
},
calc: false,
zindex: false,
autoprefixer: false,
},
],
};

const sortCSSmq = require("sort-css-media-queries")({
unitlessMqAlwaysFirst: true,
});

module.exports = {
// Add plugin names as key and arguments as value
// Install them before as dependencies with npm or yarn
map: false,
plugins: [
// Optimizations
require("node-css-mqpacker")({ sort: false }),
require("cssnano")(nano),
require("postcss-preset-env")({
stage: 4,
features: { "nesting-rules": { noIsPseudoSelector: true } },
minimumVendorImplementations: 3,
autoprefixer: false,
}),
require("cssnano")({
preset: [
"advanced",
{
discardComments: { removeAll: true },
zindex: false,
},
],
}),
require("postcss-merge-selectors")({}),
require("postcss-precision")({}),
// optimize again
require("node-css-mqpacker")({
sort: sortCSSmq.desktopFirst,
require("postcss-sort-media-queries")({
sort: "desktop-first",
configuration: { unitlessMqAlwaysFirst: true },
}),
require("cssnano")(nano),
// More weight by polyfilling
require("autoprefixer")({}),
require("postcss-custom-properties")({}),
require("postcss-merge-at-rules")({ nest: true }),
require("postcss-precision")({}),
],
env: "production",
preset: { stage: false },
};
Loading