-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Schematic fixes #10388
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
Schematic fixes #10388
Conversation
schematics/utils/ast.ts
Outdated
}); | ||
|
||
if (!styles) { | ||
throw new SchematicsException(`Could not find global styles.ext file.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it valid to call your root style file something else entirely? Can we read the first stylesheet from the config? Would it be better to just no-op if we can't find it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well there is just a styles
array where this lives which could include other stuff too. They could change it but I find it HIGHLY unlikely. I'll noop more gracefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I know if I was making a large app, I wouldn't want to have a file called styles.css
because it's too vague, so I'd rename it to something like global-styles.css
or browser-reset.css
schematics/utils/ast.ts
Outdated
const config = getConfig(host); | ||
const app = getAppFromConfig(config, '0'); | ||
const styles = app.styles.find(style => { | ||
const str = style.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const styles = app.styles.find(s => /styles\.(c|le|sc)ss/.test(s));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fancy ;P
schematics/shell/index.ts
Outdated
`<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">`); | ||
addHeadLink(host, | ||
`<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">`); | ||
addHeadLink(host, ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally prefer to not rely on newlines in template strings since it's not immediately obvious that they're intentional and someone might remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, I agree. Got a better alternative? Just /n
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, just \n
is obvious that it's intentional
@jelbourn - done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* fix(schematics): better formatting on index, insert body margin 0 * fix(schematics): fix wrong mode on init * fix(schemtic): convert == to === * fix(schematic): fix check expression * chore: pr feedback
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Addresses items in #10352
body { margin: 0; }
on initial scaffold==
to===