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

Convert CSS to SCSS #9

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,17 @@ WiredAnchor is a web project.
It creates a stylesheet for links in texts so that they are more conspicuous and better perceived by users.
As a result of this, links can be better marked and the user does not have to search for them in a time-consuming way.

If you If you want to participate in this project, create a fork first. After pushing the changes to your local repository, you can then create a pull request.
If you If you want to participate in this project, create a fork first. After pushing the changes to your local repository, you can then create a pull request.

## Using Grunt and SCSS
`cd` into your project directory and run `npm install` to install Grunt and other dependencies.

Now run `grunt watch` to have Grunt watch your SCSS file for changes to compile into the CSS file.

Never edit the CSS file directly; always work from the SCSS file as any changes made in the SCSS file will override changes in the CSS file once Grunt is run.

## Dependencies

Ensure that your system has <a href="https://www.ruby-lang.org/en/documentation/installation/">Ruby</a> installed, as well as <a href="https://nodejs.org/en/">NodeJS</a>.

To install Grunt on your system, open up your command line and run `npm install -g grunt-cli` to install Grunt globally on your machine.
21 changes: 21 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
files: {
'wiredanchor.css' : 'scss/wiredanchor.scss'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default',['watch']);
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@
"bugs": {
"url": "https://github.com/sorocabacss/wiredanchor/issues"
},
"homepage": "https://github.com/sorocabacss/wiredanchor#readme"
"homepage": "https://github.com/sorocabacss/wiredanchor#readme",
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-watch": "^1.0.0"
}
}
47 changes: 47 additions & 0 deletions scss/wiredanchor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SCSS for the main CSS file “wiredanchor.css

// Vars.
$color-primary: #ff6f6f;
$color-charcoal: #333;

// Main Styles.
.wiredanchor {
text-decoration: none;
color: $color-charcoal;
position: relative;

&:hover,
&:focus,
&:visited,
&:active {
text-decoration: none;
color: $color-primary;
}

&:hover::before {
opacity: 0.3;
}

&:before {
content:'';
opacity: 0;
transition: opacity 0.1s linear;
background-color: $color-primary;
width: 100%;
height: 82%;
position: absolute;
left: 0;
top: 0;
}

&:after {
content:'';
background-color: $color-primary;
opacity: 0.3;
width: 100%;
height: 30%;
position: absolute;
left: 0;
bottom: -10%;
}
} // .wiredanchor
62 changes: 26 additions & 36 deletions wiredanchor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.