Skip to content

Commit

Permalink
feat(facebook): use global variables
Browse files Browse the repository at this point in the history
  • Loading branch information
borisdamevin committed Apr 20, 2022
1 parent 9f846d9 commit 9c2305c
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/facebook/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
// VARIABLES //
// ============================================================================================= //

$primary: #1877f2;
$primary-rgb: rgb(24, 119, 242);
@use "sass:color";
@use "brandcolors/variables";

$primary: variables.$facebook;
$primary-rgb: rgb(color.red($primary), color.green($primary), color.blue($primary));

// ------------------------------------------------------------------------- //
// PROPERTY VALUES
Expand Down
3 changes: 3 additions & 0 deletions packages/facebook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "1.3.0",
"description": "Facebook Brand Colors.",
"main": "_index.scss",
"dependencies": {
"brandcolors": "1.3.0"
},
"files": [
"*.scss"
],
Expand Down
40 changes: 40 additions & 0 deletions packages/facebook/test/test.spec.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// ============================================================================================= //
// TEST //
// ============================================================================================= //

@use "true" as *;
@use "../index" as facebook;

@include describe("facebook") {
@include it("Should return hex color declaration.") {
@include assert {
@include output(false) {
.test {
color: facebook.$primary;
}
}

@include expect(false) {
.test {
color: #1877f2;
}
}
}
}

@include it("Should return rgb color declaration.") {
@include assert {
@include output(false) {
.test {
color: facebook.$primary-rgb;
}
}

@include expect(false) {
.test {
color: rgb(24, 119, 242);
}
}
}
}
}
1 change: 1 addition & 0 deletions tests/scss.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('Sass', () => {
file,
includePaths: [
'./node_modules',
'./packages/facebook/node_modules',
'./packages/google/node_modules',
]
}, {
Expand Down

0 comments on commit 9c2305c

Please sign in to comment.