Skip to content

Commit

Permalink
Refactor. Update Gruntfile to use Sass instead of Compass and enhance…
Browse files Browse the repository at this point in the history
… SCSS files with improved media query formatting and new utility mixins
  • Loading branch information
ayazurrehman committed Dec 22, 2024
1 parent 2b0bc53 commit df3d864
Show file tree
Hide file tree
Showing 20 changed files with 260 additions and 97 deletions.
45 changes: 31 additions & 14 deletions ui/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ module.exports = function (grunt) {
grunt.initConfig({
yeoman: yeomanConfig,
watch: {
compass: {
sass: {
files: ['<%= yeoman.app %>/styles/**/*.{scss,sass}'],
tasks: ['compass:debug']
tasks: ['sass:debug']
}
},
clean: {
Expand Down Expand Up @@ -162,21 +162,38 @@ module.exports = function (grunt) {
root: '.'
}
},
compass: {
sass: {
options: {
sassDir: '<%= yeoman.app %>/styles',
cssDir: '<%= yeoman.app %>/styles/',
imagesDir: '<%= yeoman.app %>/images',
javascriptsDir: '<%= yeoman.app %>/scripts',
fontsDir: '<%= yeoman.app %>/styles/fonts',
importPath: '<%= yeoman.app %>/components',
relativeAssets: true
implementation: require('sass'),
sourceMap: true,
includePaths: [
'<%= yeoman.app %>/components',
'<%= yeoman.app %>/styles'
]
},
dist: {
options: {
outputStyle: 'compressed'
},
files: [{
expand: true,
cwd: '<%= yeoman.app %>/styles',
src: ['**/*.{scss,sass}'],
dest: '<%= yeoman.app %>/styles/',
ext: '.css'
}]
},
dist: {},
debug: {
options: {
debugInfo: true
}
outputStyle: 'expanded'
},
files: [{
expand: true,
cwd: '<%= yeoman.app %>/styles',
src: ['**/*.{scss,sass}'],
dest: '<%= yeoman.app %>/styles/',
ext: '.css'
}]
}
},
// Renames files for browser caching purposes
Expand Down Expand Up @@ -534,7 +551,7 @@ module.exports = function (grunt) {
'eslint',
'copy:nodeModules',
'clean:dist',
'compass:dist',
'sass:dist',
'useminPrepare',
'ngAnnotate',
'concat',
Expand Down
1 change: 1 addition & 0 deletions ui/app/styles/appointmentScheduling.css.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ui/app/styles/appointments/components.css.map

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

4 changes: 2 additions & 2 deletions ui/app/styles/bahmni-components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ ul li a.back-btn, ul li a.back-btn:hover, button.back-btn, a.back-btn {
line-height: 1;
margin: 0;
padding: 0;
@media screen and(max-width:470px){
@media screen and (max-width: 470px) {
font-size: 22px;
}
}
Expand All @@ -399,7 +399,7 @@ ul li a.back-btn, ul li a.back-btn:hover, button.back-btn, a.back-btn {
}
}
}
@media screen and(max-width:470px){
@media screen and (max-width: 470px) {
padding: 4px 5px 5px;
}
}
Expand Down
29 changes: 28 additions & 1 deletion ui/app/styles/bahmni-helper/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*doc
---
title: Colors
Expand Down Expand Up @@ -332,3 +331,31 @@ $primaryItalicFont: "OpenSansItalic";
color: $text;
}
}

// Grid system mixins
@mixin column($x, $columns: 12) {
display: inline;
float: left;
width: $total-width * ((($gutter-width + $column-width) * $x - $gutter-width) / ($gutter-width + $column-width * $columns));
margin: 0 $total-width * ($gutter-width * 0.5) / ($gutter-width + $column-width * $columns);
}

// Additional utility mixins
@mixin border-radius($radius) {
border-radius: $radius;
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
}

@mixin box-shadow($shadow...) {
-webkit-box-shadow: $shadow;
-moz-box-shadow: $shadow;
box-shadow: $shadow;
}

@mixin transition($transition...) {
-webkit-transition: $transition;
-moz-transition: $transition;
-o-transition: $transition;
transition: $transition;
}
2 changes: 1 addition & 1 deletion ui/app/styles/bahmni-layout/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
margin-right: 10px;
}

@media screen and(max-width:470px) {
@media screen and (max-width: 470px) {
margin: 0;
}
}
Expand Down
1 change: 1 addition & 0 deletions ui/app/styles/clinical.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/app/styles/clinical/_consultation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

.dosage-days,
.drug-name {
@media screen and(max-width: 1024px) {
@media screen and (max-width: 1024px) {
max-width: 45%;
width: auto;
}
Expand Down
6 changes: 3 additions & 3 deletions ui/app/styles/clinical/_diagnosis.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
box-sizing: border-box;
border-bottom: none;

@media screen and(min-width: 992px) {
@media screen and (min-width: 992px) {
border-bottom: 1px solid $lightGray;
}
}
Expand Down Expand Up @@ -442,7 +442,7 @@
right: 20px;
bottom: 20px;

@media screen and(min-width: 992px) {
@media screen and (min-width: 992px) {
top: 20px;
bottom: auto;
right: 215px;
Expand Down Expand Up @@ -747,7 +747,7 @@
.col2.notes-subscriber {
display: none;

@media screen and(min-width: 768px) {
@media screen and (min-width: 768px) {
display: block;
}
}
Expand Down
4 changes: 2 additions & 2 deletions ui/app/styles/clinical/_patientDashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ table.treatments-details-table {
width: 50%;
float: left;

@media screen and(max-width:540px) {
@media screen and (max-width:540px) {
width: 100%;
}
}
Expand All @@ -1523,7 +1523,7 @@ table.treatments-details-table {
width: 50%;
}

@media screen and(max-width:540px) {
@media screen and (max-width:540px) {
width: 100%;
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/styles/clinical/_visit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
width: 50%;
}

@media screen and(max-width:540px) {
@media screen and (max-width: 540px) {
width: 100%;
}
}
Expand Down
1 change: 1 addition & 0 deletions ui/app/styles/clinicalPrint.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/app/styles/common/_bahmniGlobal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ u,
}

.print {
@media screen and(max-width: 700px) {
@media screen and (max-width: 700px) {
display: none;
}
}
Expand Down
1 change: 1 addition & 0 deletions ui/app/styles/home.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/app/styles/home/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $gutter-width: 0;
$columns: 12;
$total-width: 100%;

@import "compass";
@import "bahmni-helper/variables";

/*** grid form elements css start ***/
.form-field-inline {
Expand Down
1 change: 1 addition & 0 deletions ui/app/styles/print.css.map

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

1 change: 1 addition & 0 deletions ui/app/styles/registration.css.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ui/app/styles/registrationPrint.css.map

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

5 changes: 3 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"grunt": "^1.0.3",
"grunt-comment-toggler": "^0.2.2",
"grunt-contrib-clean": "2.0.0",
"grunt-contrib-compass": "1.1.1",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-cssmin": "~1.0.0",
Expand All @@ -87,6 +86,7 @@
"grunt-ng-annotate": "^3.0.0",
"grunt-preprocess": "^5.0.1",
"grunt-rename": "~0.1.3",
"grunt-sass": "^3.1.0",
"grunt-usemin": "~3.1.1",
"karma": "^4.0.0",
"karma-chrome-launcher": "^2.2.0",
Expand All @@ -97,7 +97,8 @@
"karma-ng-html2js-preprocessor": "^1.0.0",
"matchdep": "^2.0.0",
"react": "16.14.0",
"react-dom": "16.14.0"
"react-dom": "16.14.0",
"sass": "^1.32.8"
},
"resolutions": {
"**/**/xmlhttprequest-ssl": "^1.6.1",
Expand Down
Loading

0 comments on commit df3d864

Please sign in to comment.