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

Prettier on scss and css files generated + reformat css.ejs and scss.ejs #7476

Merged
merged 4 commits into from
Apr 14, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions generators/client/templates/angular/.prettierignore.ejs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
target
11 changes: 8 additions & 3 deletions generators/client/templates/angular/.prettierrc.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Prettier configuration

printWidth: 140
singleQuote: true
jsxBracketSameLine: false
parser: typescript
arrowParens: avoid
tabWidth: 4
useTabs: false

# js and ts rules:
arrowParens: avoid

# jsx and tsx rules:
jsxBracketSameLine: false
4 changes: 2 additions & 2 deletions generators/client/templates/angular/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@
},
<%_ if(!skipCommitHook) { _%>
"lint-staged": {
"*.ts": ["prettier --write", "git add"]
"src/**/*.{ts,css,scss}": ["prettier --write", "git add"]
},
<%_ } _%>
"scripts": {
<%_ if(!skipCommitHook) { _%>
"precommit": "lint-staged",
<%_ } _%>
"prettier:format":"<%= clientPackageManager %> prettier --write **/*.ts",
"prettier:format":"<%= clientPackageManager %> prettier --write 'src/**/*.{ts,css,scss}'",
"lint": "tslint --project tsconfig.json -e 'node_modules/**'",
"lint:fix": "<%= clientPackageManager %> run lint -- --fix",
"ngc": "ngc -p tsconfig-aot.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
start Password strength bar style
========================================================================== */
ul#strengthBar {
display:inline;
list-style:none;
margin:0;
margin-left:15px;
padding:0;
vertical-align:2px;
display: inline;
list-style: none;
margin: 0;
margin-left: 15px;
padding: 0;
vertical-align: 2px;
}

.point:last {
margin:0 !important;
margin: 0 !important;
}
.point {
background:#DDD;
border-radius:2px;
display:inline-block;
height:5px;
margin-right:1px;
width:20px;
background: #ddd;
border-radius: 2px;
display: inline-block;
height: 5px;
margin-right: 1px;
width: 20px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
start Password strength bar style
========================================================================== */
ul#strength {
display:inline;
list-style:none;
margin:0;
margin-left:15px;
padding:0;
vertical-align:2px;
display: inline;
list-style: none;
margin: 0;
margin-left: 15px;
padding: 0;
vertical-align: 2px;
}

.point {
background:#DDD;
border-radius:2px;
display:inline-block;
height:5px;
margin-right:1px;
width:20px;
background: #ddd;
border-radius: 2px;
display: inline-block;
height: 5px;
margin-right: 1px;
width: 20px;
&:last {
margin:0 !important;
margin: 0 !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ Main page styles
}

/* wait autoprefixer update to allow simple generation of high pixel density media query */
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min--moz-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
.hipster {
background: url("../../content/images/hipster2x.png") no-repeat center top;
background: url("../../content/images/hipster2x.png") no-repeat center
top;
background-size: contain;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ Main page styles
}

/* wait autoprefixer update to allow simple generation of high pixel density media query */
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min--moz-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
.hipster {
background: url("../../content/images/hipster2x.png") no-repeat center top;
background: url("../../content/images/hipster2x.png") no-repeat center
top;
background-size: contain;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Navbar
========================================================================== */
.navbar-version {
font-size: 10px;
color: #ccc
color: #ccc;
}

.jh-navbar {
background-color: #353d47;
padding: .2em 1em;
padding: 0.2em 1em;
}

.jh-navbar .profile-image {
Expand All @@ -36,7 +36,9 @@ Navbar
border-radius: 50%;
}

.jh-navbar .dropdown-item.active, .jh-navbar .dropdown-item.active:focus, .jh-navbar .dropdown-item.active:hover {
.jh-navbar .dropdown-item.active,
.jh-navbar .dropdown-item.active:focus,
.jh-navbar .dropdown-item.active:hover {
background-color: #353d47;
}

Expand Down Expand Up @@ -99,7 +101,8 @@ Logo styles

.logo-img {
height: 100%;
background: url("../../../content/images/logo-jhipster.png") no-repeat center center;
background: url("../../../content/images/logo-jhipster.png") no-repeat
center center;
background-size: contain;
width: 100%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,24 @@
/* ==========================================================================
Navbar
========================================================================== */

.navbar-version {
font-size: 10px;
color: #ccc
color: #ccc;
}

.jh-navbar {
background-color: #353d47;
padding: .2em 1em;
padding: 0.2em 1em;
.profile-image {
margin: -10px 0px;
height: 40px;
width: 40px;
border-radius: 50%;
}
.dropdown-item.active, .dropdown-item.active:focus, .dropdown-item.active:hover {
.dropdown-item.active,
.dropdown-item.active:focus,
.dropdown-item.active:hover {
background-color: #353d47;
}
.dropdown-toggle::after {
Expand Down Expand Up @@ -87,7 +90,8 @@ Logo styles
width: 70px;
display: inline-block;
vertical-align: middle;
background: url("../../../content/images/logo-jhipster.png") no-repeat center center;
background: url("../../../content/images/logo-jhipster.png")
no-repeat center center;
background-size: contain;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ Generic styles
========================================================================== */

/* Error highlight on input fields */
.ng-valid[required], .ng-valid.required {
border-left: 5px solid green;
.ng-valid[required],
.ng-valid.required {
border-left: 5px solid green;
}

.ng-invalid:not(form) {
border-left: 5px solid red;
.ng-invalid:not(form) {
border-left: 5px solid red;
}

/* other generic styles */
Expand Down Expand Up @@ -88,7 +89,7 @@ Generic styles

.break {
white-space: normal;
word-break:break-all;
word-break: break-all;
}

.readonly {
Expand All @@ -97,27 +98,28 @@ Generic styles
}

.footer {
border-top: 1px solid rgba(0,0,0,.125);
border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* ==========================================================================
make sure browsers use the pointer cursor for anchors, even with no href
========================================================================== */
a:hover {
cursor: pointer;
cursor: pointer;
}

.hand, [jhisortby] {
.hand,
[jhisortby] {
cursor: pointer;
}

/* ==========================================================================
Custom alerts for notification
========================================================================== */
.alerts .alert{
.alerts .alert {
text-overflow: ellipsis;
}
.alert pre{
.alert pre {
background: none;
border: none;
font: inherit;
Expand Down Expand Up @@ -161,26 +163,38 @@ Custom alerts for notification
entity tables helpers
========================================================================== */
/* Remove Bootstrap padding from the element
http://stackoverflow.com/questions/19562903/remove-padding-from-columns-in-bootstrap-3 */
.no-padding-left { padding-left: 0 !important; }
.no-padding-right { padding-right: 0 !important; }
.no-padding-top { padding-top: 0 !important; }
.no-padding-bottom { padding-bottom: 0 !important; }
.no-padding { padding: 0 !important; }
http://stackoverflow.com/questions/19562903/remove-padding-from-columns-in-bootstrap-3 */
.no-padding-left {
padding-left: 0 !important;
}
.no-padding-right {
padding-right: 0 !important;
}
.no-padding-top {
padding-top: 0 !important;
}
.no-padding-bottom {
padding-bottom: 0 !important;
}
.no-padding {
padding: 0 !important;
}

/* bootstrap 3 input-group 100% width
http://stackoverflow.com/questions/23436430/bootstrap-3-input-group-100-width */
.width-min { width: 1% !important; }
http://stackoverflow.com/questions/23436430/bootstrap-3-input-group-100-width */
.width-min {
width: 1% !important;
}

/* Makes toolbar not wrap on smaller screens
http://www.sketchingwithcss.com/samplechapter/cheatsheet.html#right */
http://www.sketchingwithcss.com/samplechapter/cheatsheet.html#right */
.flex-btn-group-container {
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
flex-direction: row;
-webkit-justify-content: flex-end;
justify-content: flex-end;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
flex-direction: row;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}

/* ==========================================================================
Expand All @@ -205,17 +219,20 @@ entity detail page css
/* ==========================================================================
ui bootstrap tweaks
========================================================================== */
.nav, .pagination, .carousel, .card-title a {
.nav,
.pagination,
.carousel,
.card-title a {
cursor: pointer;
}

.datetime-picker-dropdown > li.date-picker-menu div > table .btn-secondary,
.uib-datepicker-popup > li > div.uib-datepicker > table .btn-secondary {
.uib-datepicker-popup > li > div.uib-datepicker > table .btn-secondary {
border: 0;
}

.datetime-picker-dropdown > li.date-picker-menu div > table:focus,
.uib-datepicker-popup > li > div.uib-datepicker > table:focus {
.uib-datepicker-popup > li > div.uib-datepicker > table:focus {
outline: none;
}

Expand All @@ -224,6 +241,6 @@ ui bootstrap tweaks
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

/* jhipster-needle-css-add-main JHipster will add new css style */