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

Fix CSS files rendering for branding folder #5828

Merged
merged 2 commits into from
Apr 20, 2018

Conversation

mbalani
Copy link
Contributor

@mbalani mbalani commented Apr 19, 2018

Styles are not being rendered from ~/Branding/Content/ folder. It’s only getting rendered from ~/Content/ and it’s subfolders.

In AppActivator.cs code file, StyleBundle includes files from ~/Content/ and ~/Branding/Content/ as follows:

Bundle stylesBundle = new StyleBundle("~/Content/css");
            foreach (string filename in new[] {
                    "Site.css",
                    "Layout.css",
                    "PageStylings.css",
                    "fabric.css",
                })
            {
                stylesBundle
                    .Include("~/Content/" + filename)
                    .Include("~/Branding/Content/" + filename);
            }

But styles/.css files that I added under ~/Branding/Content/ folder is not being rendered at all. That defeats the purpose of having this folder.
After trial/error and some reading, I found out following article that mentions same StyleBundle won’t work for different directories (root directories), like Content and Branding in this case.
https://stackoverflow.com/questions/30120357/bundling-files-in-different-directories
So I added another include statement to add ~/Content/Branding/ folder without removing ~/Branding/Content/.
In my opinion, include statement of ~/Branding/Content/ should be deleted because it’s not providing any value if it’s not rendering files from that folder. But I left it there for NuGet team to decide.

P.S.: I tried having two StyleBundles one with Content folder and other StyleBundle with \Branding\Content folder, but couldn't use different StyleBundles on the same page.

Copy link
Member

@joelverhagen joelverhagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it's fine that we leave ~/Content/Branding/.

@joelverhagen joelverhagen changed the base branch from master to dev April 20, 2018 20:59
@joelverhagen joelverhagen merged commit fcd6626 into NuGet:dev Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants