CSS resource not being included in Stash web-item plugin module

I've got the following Stash plugin module definition:

<web-item key="header" name="My Header" weight="40" section="header.global.secondary">

<styleClass>total</styleClass>

<tooltip>Total</tooltip>

<resource type="download" name="total.css" location="css/total.css"/>

<condition class="com.atlassian.stash.web.conditions.IsLoggedInCondition"/>

<context-provider class="plugin.contextproviders.TotalContextProvider"/>

<label>$total dollars</label>

</web-item>

However, when I start up Stash (atlas-run) the styling I've included in total.css (making the background-color red) isn't being applied. I can't see the total.css file included anywhere when I use Chrome Dev Tools to try and find it, and the style applies fine if I manually edit the css in Chrome Dev Tools.

Any idea why the style isn't being applied and why I can't see the CSS being downloaded/included anywhere?

1 answer

1 accepted

Hi Annie,

I'm afraid to say that it appears that web-items don't support download resources. You'll have to add the resource another way. You could do that with with an extra web-resource (or stash-resource) with a context (like global or atl.general).

Cheers,

Charles

Awesome, I added a web-resource with atl.general context and it works as I want it to :) Thanks!

Seb Ruiz Atlassian Team Apr 04, 2013

Hi Annie,

Using atl.general is not recommended, as it adds your resources to every page in Stash. Unless you actually need to target every page, please take a look at https://developer.atlassian.com/stash/docs/latest/reference/web-resource-contexts.html for a more appropriate context (nb: atl.general does not hit admin pages)

Hey Seb, thanks for the advice. I do actually need it to display on every page - so I guess I should apply it to the atl.general *and* atl.admin.

Hi Annie,

Adding both contexts to your resource is correct then.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

662 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot