Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(settings): 🎨 update structure with adding _settings.scss w… #21

Merged
merged 1 commit into from
Jun 4, 2024
Merged
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"testing",
"functions-map",
"security",
"mixins-logical-props"
"mixins-logical-props",
"settings"
],
"cSpell.words": ["Giraudel"]
}
6 changes: 0 additions & 6 deletions src/abstract/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@

// stylelint-disable scss/dollar-variable-empty-line-before

$lib-name: sass-pire !default;

$brand-lib-name: sp !default;

$author-names: ("Khaled Mohamed");

$base-font-size: 16;

// @note
Expand Down
6 changes: 6 additions & 0 deletions src/abstract/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@
// * It allows you to use these configurations in other files.
// @see config
@forward "config";

// * forwarded settings.
// * This module forwards the settings for library.
// * It allows you to use these settings in other files.
// @see settings
@forward "settings";
29 changes: 29 additions & 0 deletions src/abstract/_settings.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@charset "UTF-8";

// @access public

// @version 1.0.0

// @author Khaled Mohamed

// @license MIT

// @repository: https://github.com/ZexLabs/sass-pire

// @namespace abstract

// @module abstract/settings

// stylelint-disable scss/dollar-variable-empty-line-before

$organization-name: "ZexLabs" !default;

$lib-name: sass-pire !default;

$brand-lib-name: sp !default;

$author-names: ("Khaled Mohamed");

$current-year: 2024;

$current-version: "v1.9.6";
10 changes: 5 additions & 5 deletions src/base/_banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@

// stylelint-disable comment-empty-line-before

@use "../abstract/config" as Config;
@use "../abstract/settings" as Settings;

@mixin banner() {
/*
***** #{Config.$lib-name} library v1.9.6
***** #{Settings.$lib-name} library #{Settings.$current-version}

***** Copyright © 2024 for #{Config.$lib-name} authors.
***** Copyright © #{Settings.$current-year} for #{Settings.$lib-name} authors.

***** All copyrights reserved to ZexLabs Organization owners.
***** All copyrights reserved to #{Settings.$organization-name} Organization owners.

***** Author(s):
***** #{Config.$author-names}.
***** #{Settings.$author-names}.

***** Licensed under MIT.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/base/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
// @repository: https://github.com/ZexLabs/sass-pire

@use "../abstract/config" as var;
@use "../abstract/settings" as Settings;
@use "../mixins/general/reset" as LibMixin1;
@use "../base/banner" as LibMixin2;

// * stylelint-disable-next-line at-rule-empty-line-before
@include LibMixin2.banner;

@if var.$use-layer-version == true {
@layer #{var.$brand-lib-name + "-reset"} {
@layer #{Settings.$brand-lib-name + "-reset"} {
@include LibMixin1.reset;
}
} @else {
Expand Down
12 changes: 6 additions & 6 deletions src/mixins/general/_color-generator-vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// @dependencies:
// * - meta.type-of (SASS function).
// * - Config.$brand-lib-name (config variable).
// * - Settings.$brand-lib-name (settings variable).

// @param {String} $brand-name
// * The brand name or namespace for the color variables.
Expand Down Expand Up @@ -65,7 +65,7 @@

// @note 1
// * Make sure to include the "variables" module where the
// * "$brand-lib-name" variable configuration is defined.
// * "$brand-lib-name" settings variable is defined.

// @note 2
// * There are two mixins in this file.
Expand All @@ -77,9 +77,9 @@
@use "sass:meta";
@use "sass:list";
@use "sass:string";
@use "../../abstract/config" as Config;
@use "../../abstract/settings" as Settings;

@mixin generate-colors($brand-name: Config.$brand-lib-name, $color-map: ()) {
@mixin generate-colors($brand-name: Settings.$brand-lib-name, $color-map: ()) {
@if meta.type-of($brand-name) != string {
@error "Brand name must be in string type.";
}
Expand All @@ -103,14 +103,14 @@
}

@if $brand-name == "" or $brand-name == def {
--#{Config.$brand-lib-name}-#{string.to-lower-case($clr)}-clr: #{$val};
--#{Settings.$brand-lib-name}-#{string.to-lower-case($clr)}-clr: #{$val};
} @else {
--#{string.to-lower-case($brand-name)}-#{string.to-lower-case($clr)}-clr: #{$val};
}
}
}
}

@mixin gen-clrs($brand-name: Config.$brand-lib-name, $color-map: ()) {
@mixin gen-clrs($brand-name: Settings.$brand-lib-name, $color-map: ()) {
@include generate-colors($brand-name, $color-map);
}